balibabu commited on
Commit
240ac86
·
1 Parent(s): d7e5a50

fix: Chunks cannot be deleted #1912 (#1913)

Browse files

### 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 CHANGED
@@ -124,7 +124,7 @@ export const useDeleteChunk = () => {
124
  mutateAsync,
125
  } = useMutation({
126
  mutationKey: ['deleteChunk'],
127
- mutationFn: async (params: { chunkIds: string[]; documentId: string }) => {
128
  const { data } = await kbService.rm_chunk(params);
129
  if (data.retcode === 0) {
130
  setPaginationParams(1);
 
124
  mutateAsync,
125
  } = useMutation({
126
  mutationKey: ['deleteChunk'],
127
+ mutationFn: async (params: { chunkIds: string[]; doc_id: string }) => {
128
  const { data } = await kbService.rm_chunk(params);
129
  if (data.retcode === 0) {
130
  setPaginationParams(1);
web/src/pages/add-knowledge/components/knowledge-chunk/hooks.ts CHANGED
@@ -67,7 +67,7 @@ export const useDeleteChunkByIds = (): {
67
 
68
  const removeChunk = useCallback(
69
  (chunkIds: string[], documentId: string) => () => {
70
- return deleteChunk({ chunkIds, documentId });
71
  },
72
  [deleteChunk],
73
  );
 
67
 
68
  const removeChunk = useCallback(
69
  (chunkIds: string[], documentId: string) => () => {
70
+ return deleteChunk({ chunkIds, doc_id: documentId });
71
  },
72
  [deleteChunk],
73
  );