瀏覽代碼

fix: fixed an issue where an error was reported when fetching the file list after changing the parsing type (#150)

tags/v0.1.0
balibabu 1 年之前
父節點
當前提交
0dd5b58d03
沒有連結到貢獻者的電子郵件帳戶。

+ 3
- 9
web/src/pages/add-knowledge/components/knowledge-dataset/knowledge-upload-file/index.tsx 查看文件

} 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;
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({
type: 'kFModel/document_change_parser',
payload: {
parser_id: parserId,
doc_id: documentId,
parser_config: parserConfig,
},
});
setDocumentParser(parserId, documentId, parserConfig as any);
}; };


const onChange = (e: RadioChangeEvent) => { const onChange = (e: RadioChangeEvent) => {

Loading…
取消
儲存