mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Display the document configuration dialog with shadcn #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import {
|
||||
IKnowledge,
|
||||
IKnowledgeResult,
|
||||
INextTestingResult,
|
||||
} from '@/interfaces/database/knowledge';
|
||||
@ -22,6 +23,7 @@ export const enum KnowledgeApiAction {
|
||||
CreateKnowledge = 'createKnowledge',
|
||||
DeleteKnowledge = 'deleteKnowledge',
|
||||
SaveKnowledge = 'saveKnowledge',
|
||||
FetchKnowledgeDetail = 'fetchKnowledgeDetail',
|
||||
}
|
||||
|
||||
export const useKnowledgeBaseId = () => {
|
||||
@ -204,3 +206,21 @@ export const useUpdateKnowledge = (shouldFetchList = false) => {
|
||||
|
||||
return { data, loading, saveKnowledgeConfiguration: mutateAsync };
|
||||
};
|
||||
|
||||
export const useFetchKnowledgeBaseConfiguration = () => {
|
||||
const { id } = useParams();
|
||||
|
||||
const { data, isFetching: loading } = useQuery<IKnowledge>({
|
||||
queryKey: [KnowledgeApiAction.FetchKnowledgeDetail],
|
||||
initialData: {} as IKnowledge,
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data } = await kbService.get_kb_detail({
|
||||
kb_id: id,
|
||||
});
|
||||
return data?.data ?? {};
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user