Fix: The file upload prompt indicates "No authorization." #6516 (#6756)

### What problem does this PR solve?

Fix: The file upload prompt indicates "No authorization." #6516

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu 2025-04-02 15:52:35 +08:00 committed by GitHub
parent aa25d09b0c
commit 160bf4ccb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -345,12 +345,17 @@ export const useRunNextDocument = () => {
export const useFetchDocumentInfosByIds = () => {
const [ids, setDocumentIds] = useState<string[]>([]);
const idList = useMemo(() => {
return ids.filter((x) => typeof x === 'string' && x !== '');
}, [ids]);
const { data } = useQuery<IDocumentInfo[]>({
queryKey: ['fetchDocumentInfos', ids],
enabled: ids.length > 0,
queryKey: ['fetchDocumentInfos', idList],
enabled: idList.length > 0,
initialData: [],
queryFn: async () => {
const { data } = await kbService.document_infos({ doc_ids: ids });
const { data } = await kbService.document_infos({ doc_ids: idList });
if (data.code === 0) {
return data.data;
}