Browse Source

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)
tags/v0.18.0
balibabu 7 months ago
parent
commit
160bf4ccb3
No account linked to committer's email address
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      web/src/hooks/document-hooks.ts

+ 8
- 3
web/src/hooks/document-hooks.ts 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;
}

Loading…
Cancel
Save