mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: change all file names to lowercase #1574 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
24
web/src/hooks/chunk-hooks.ts
Normal file
24
web/src/hooks/chunk-hooks.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useDispatch } from 'umi';
|
||||
import { useGetKnowledgeSearchParams } from './route-hook';
|
||||
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user