fix: Change document status with @tanstack/react-query #13306 (#2788)

### What problem does this PR solve?

fix: Change document status with @tanstack/react-query #13306

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
This commit is contained in:
balibabu
2024-10-11 08:45:10 +08:00
committed by GitHub
parent 2c56d274d8
commit a2f9c03a95
20 changed files with 375 additions and 865 deletions

View File

@ -1,6 +1,6 @@
import { useShowDeleteConfirm, useTranslate } from '@/hooks/common-hooks';
import { useRemoveDocument } from '@/hooks/document-hooks';
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
import { useRemoveNextDocument } from '@/hooks/document-hooks';
import { IDocumentInfo } from '@/interfaces/database/document';
import { api_host } from '@/utils/api';
import { downloadFile } from '@/utils/file-util';
import {
@ -15,8 +15,8 @@ import { isParserRunning } from '../utils';
import styles from './index.less';
interface IProps {
record: IKnowledgeFile;
setCurrentRecord: (record: IKnowledgeFile) => void;
record: IDocumentInfo;
setCurrentRecord: (record: IDocumentInfo) => void;
showRenameModal: () => void;
showChangeParserModal: () => void;
}
@ -30,7 +30,7 @@ const ParsingActionCell = ({
const documentId = record.id;
const isRunning = isParserRunning(record.run);
const { t } = useTranslate('knowledgeDetails');
const removeDocument = useRemoveDocument();
const { removeDocument } = useRemoveNextDocument();
const showDeleteConfirm = useShowDeleteConfirm();
const onRmDocument = () => {