mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-23 11:04:24 +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 = () => {
|
export const useFetchDocumentInfosByIds = () => {
|
||||||
const [ids, setDocumentIds] = useState<string[]>([]);
|
const [ids, setDocumentIds] = useState<string[]>([]);
|
||||||
|
|
||||||
|
const idList = useMemo(() => {
|
||||||
|
return ids.filter((x) => typeof x === 'string' && x !== '');
|
||||||
|
}, [ids]);
|
||||||
|
|
||||||
const { data } = useQuery<IDocumentInfo[]>({
|
const { data } = useQuery<IDocumentInfo[]>({
|
||||||
queryKey: ['fetchDocumentInfos', ids],
|
queryKey: ['fetchDocumentInfos', idList],
|
||||||
enabled: ids.length > 0,
|
enabled: idList.length > 0,
|
||||||
initialData: [],
|
initialData: [],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data } = await kbService.document_infos({ doc_ids: ids });
|
const { data } = await kbService.document_infos({ doc_ids: idList });
|
||||||
if (data.code === 0) {
|
if (data.code === 0) {
|
||||||
return data.data;
|
return data.data;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user