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:
balibabu
2026-04-16 18:46:52 +08:00
committed by GitHub
parent 901023a80a
commit 4cf4d444d2
7 changed files with 14 additions and 215 deletions

View File

@@ -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 };
};