mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-03 22:30:31 +08:00
Fix: Login page type error. (#14156)
### What problem does this PR solve? Fix: Login page type error. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { useHandleFilterSubmit } from '@/components/list-filter-bar/use-handle-filter-submit';
|
||||
import { post } from '@/utils/next-request';
|
||||
|
||||
import message from '@/components/ui/message';
|
||||
import { RunningStatus } from '@/constants/knowledge';
|
||||
@@ -21,7 +20,7 @@ import kbService, {
|
||||
renameDocument,
|
||||
uploadDocument,
|
||||
} from '@/services/knowledge-service';
|
||||
import api, { restAPIv1, webAPI } from '@/utils/api';
|
||||
import { restAPIv1, webAPI } from '@/utils/api';
|
||||
import { getSearchValue } from '@/utils/common-util';
|
||||
import { buildChunkHighlights } from '@/utils/document-util';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
@@ -564,26 +563,3 @@ export const useFetchDocumentThumbnailsByIds = () => {
|
||||
|
||||
return { data, setDocumentIds };
|
||||
};
|
||||
|
||||
export const useParseDocument = () => {
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
mutateAsync,
|
||||
} = useMutation({
|
||||
mutationKey: [DocumentApiAction.ParseDocument],
|
||||
mutationFn: async (url: string) => {
|
||||
try {
|
||||
const { data } = await post(api.parse, { url });
|
||||
if (data?.code === 0) {
|
||||
message.success(i18n.t('message.uploaded'));
|
||||
}
|
||||
return data;
|
||||
} catch (error) {
|
||||
message.error('error');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return { parseDocument: mutateAsync, data, loading };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user