mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-10-07 14:06:44 +00:00
25 lines
548 B
TypeScript
25 lines
548 B
TypeScript
![]() |
import { useCallback } from 'react';
|
||
|
import { useDispatch } from 'umi';
|
||
|
import { useGetKnowledgeSearchParams } from './routeHook';
|
||
|
|
||
|
interface PayloadType {
|
||
|
doc_id: string;
|
||
|
keywords?: string;
|
||
|
}
|
||
|
|
||
|
export const useFetchChunkList = () => {
|
||
|
const dispatch = useDispatch();
|
||
|
const { documentId } = useGetKnowledgeSearchParams();
|
||
|
|
||
|
const fetchChunkList = useCallback(() => {
|
||
|
dispatch({
|
||
|
type: 'chunkModel/chunk_list',
|
||
|
payload: {
|
||
|
doc_id: documentId,
|
||
|
},
|
||
|
});
|
||
|
}, [dispatch, documentId]);
|
||
|
|
||
|
return fetchChunkList;
|
||
|
};
|