소스 검색

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
No account linked to committer's email address
1개의 변경된 파일3개의 추가작업 그리고 9개의 파일을 삭제
  1. 3
    9
      web/src/pages/add-knowledge/components/knowledge-dataset/knowledge-upload-file/index.tsx

+ 3
- 9
web/src/pages/add-knowledge/components/knowledge-dataset/knowledge-upload-file/index.tsx 파일 보기

@@ -44,6 +44,7 @@ import {
} from 'react';
import { Link, useDispatch, useNavigate } from 'umi';

import { useSetDocumentParser } from '@/hooks/documentHooks';
import styles from './index.less';

const { Dragger } = Upload;
@@ -66,21 +67,14 @@ const UploaderItem = ({
const { parserConfig, defaultParserId } = useGetDocumentDefaultParser();
const { removeDocument } = useDeleteDocumentById();
const [value, setValue] = useState(defaultParserId);
const dispatch = useDispatch();
const setDocumentParser = useSetDocumentParser();

const documentId = file?.response?.id;

const parserList = useSelectParserList();

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) => {

Loading…
취소
저장