### 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
1 changed files with 8 additions and 3 deletions
|
|
@ -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…
Add table
Reference in a new issue