mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix: fixed an issue where an error was reported when fetching the file list after changing the parsing type (#150)
This commit is contained in:
@ -44,6 +44,7 @@ import {
|
|||||||
} from 'react';
|
} from 'react';
|
||||||
import { Link, useDispatch, useNavigate } from 'umi';
|
import { Link, useDispatch, useNavigate } from 'umi';
|
||||||
|
|
||||||
|
import { useSetDocumentParser } from '@/hooks/documentHooks';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
const { Dragger } = Upload;
|
const { Dragger } = Upload;
|
||||||
@ -66,21 +67,14 @@ const UploaderItem = ({
|
|||||||
const { parserConfig, defaultParserId } = useGetDocumentDefaultParser();
|
const { parserConfig, defaultParserId } = useGetDocumentDefaultParser();
|
||||||
const { removeDocument } = useDeleteDocumentById();
|
const { removeDocument } = useDeleteDocumentById();
|
||||||
const [value, setValue] = useState(defaultParserId);
|
const [value, setValue] = useState(defaultParserId);
|
||||||
const dispatch = useDispatch();
|
const setDocumentParser = useSetDocumentParser();
|
||||||
|
|
||||||
const documentId = file?.response?.id;
|
const documentId = file?.response?.id;
|
||||||
|
|
||||||
const parserList = useSelectParserList();
|
const parserList = useSelectParserList();
|
||||||
|
|
||||||
const saveParser = (parserId: string) => {
|
const saveParser = (parserId: string) => {
|
||||||
dispatch({
|
setDocumentParser(parserId, documentId, parserConfig as any);
|
||||||
type: 'kFModel/document_change_parser',
|
|
||||||
payload: {
|
|
||||||
parser_id: parserId,
|
|
||||||
doc_id: documentId,
|
|
||||||
parser_config: parserConfig,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (e: RadioChangeEvent) => {
|
const onChange = (e: RadioChangeEvent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user