mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-21 05:29:57 +08:00
### 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:
parent
aa25d09b0c
commit
160bf4ccb3
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user