fix: fetch the file list after uploading the file by @tanstack/react-query #1306 (#1654)

### What problem does this PR solve?
fix: fetch the file list after uploading the file by
@tanstack/react-query #1306

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-07-23 17:53:15 +08:00
committed by GitHub
parent 022afbb39d
commit 80d703f9c2
7 changed files with 136 additions and 405 deletions

View File

@ -1,4 +1,4 @@
import { useFetchNextFileList } from '@/hooks/file-manager-hooks';
import { useFetchFileList } from '@/hooks/file-manager-hooks';
import { IFile } from '@/interfaces/database/file-manager';
import { formatDate } from '@/utils/date';
import { Button, Flex, Space, Table, Tag, Typography } from 'antd';
@ -12,7 +12,6 @@ import {
useHandleUploadFile,
useNavigateToOtherFolder,
useRenameCurrentFile,
useSelectFileListLoading,
} from './hooks';
import FileUploadModal from '@/components/file-upload-modal';
@ -31,7 +30,6 @@ const FileManager = () => {
const { t } = useTranslate('fileManager');
// const fileList = useSelectFileList();
const { rowSelection, setSelectedRowKeys } = useGetRowSelection();
const loading = useSelectFileListLoading();
const navigateToOtherFolder = useNavigateToOtherFolder();
const {
fileRenameVisible,
@ -64,8 +62,8 @@ const FileManager = () => {
connectToKnowledgeLoading,
} = useHandleConnectToKnowledge();
// const { pagination } = useGetFilesPagination();
const { pagination, data, searchString, handleInputChange } =
useFetchNextFileList();
const { pagination, data, searchString, handleInputChange, loading } =
useFetchFileList();
const columns: ColumnsType<IFile> = [
{
title: t('name'),