From 936d8ab7dd2d565eb87633c53d0c7319ba23b4a5 Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 12 Aug 2024 17:29:44 +0800 Subject: [PATCH] fix: Chunks cannot be deleted #1912 (#1913) ### What problem does this PR solve? fix: Chunks cannot be deleted #1912 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/hooks/chunk-hooks.ts | 2 +- web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/hooks/chunk-hooks.ts b/web/src/hooks/chunk-hooks.ts index 2b1c64153e..0a5cc6c22b 100644 --- a/web/src/hooks/chunk-hooks.ts +++ b/web/src/hooks/chunk-hooks.ts @@ -124,7 +124,7 @@ export const useDeleteChunk = () => { mutateAsync, } = useMutation({ mutationKey: ['deleteChunk'], - mutationFn: async (params: { chunkIds: string[]; documentId: string }) => { + mutationFn: async (params: { chunkIds: string[]; doc_id: string }) => { const { data } = await kbService.rm_chunk(params); if (data.retcode === 0) { setPaginationParams(1); diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts b/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts index 0eef37987c..1db791f9db 100644 --- a/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts +++ b/web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts @@ -67,7 +67,7 @@ export const useDeleteChunkByIds = (): { const removeChunk = useCallback( (chunkIds: string[], documentId: string) => () => { - return deleteChunk({ chunkIds, documentId }); + return deleteChunk({ chunkIds, doc_id: documentId }); }, [deleteChunk], );