feat: fetch conversation and delete chat dialog (#69)

* feat: set chat configuration to backend

* feat: exclude unEnabled variables

* feat: delete chat dialog

* feat: fetch conversation
This commit is contained in:
balibabu
2024-02-22 17:14:25 +08:00
committed by GitHub
parent cacd36c5e1
commit 5a0f1d2b84
22 changed files with 784 additions and 116 deletions

View File

@ -125,11 +125,18 @@ export const useFetchKnowledgeBaseConfiguration = () => {
}, [fetchKnowledgeBaseConfiguration]);
};
export const useFetchKnowledgeList = (): IKnowledge[] => {
export const useFetchKnowledgeList = (
shouldFilterListWithoutDocument: boolean = false,
): IKnowledge[] => {
const dispatch = useDispatch();
const knowledgeModel = useSelector((state: any) => state.knowledgeModel);
const { data = [] } = knowledgeModel;
const list = useMemo(() => {
return shouldFilterListWithoutDocument
? data.filter((x: IKnowledge) => x.doc_num > 0)
: data;
}, [data, shouldFilterListWithoutDocument]);
const fetchList = useCallback(() => {
dispatch({
@ -141,5 +148,5 @@ export const useFetchKnowledgeList = (): IKnowledge[] => {
fetchList();
}, [fetchList]);
return data;
return list;
};