feat: add update chunk API endpoint and service method

This commit is contained in:
Siddhant Rai
2025-02-10 09:36:18 +05:30
parent 1f0366c989
commit 7623bde159
6 changed files with 330 additions and 119 deletions

View File

@@ -29,6 +29,7 @@ const endpoints = {
ADD_CHUNK: '/api/add_chunk',
DELETE_CHUNK: (docId: string, chunkId: string) =>
`/api/delete_chunk?id=${docId}&chunk_id=${chunkId}`,
UPDATE_CHUNK: '/api/update_chunk',
},
CONVERSATION: {
ANSWER: '/api/answer',

View File

@@ -57,6 +57,8 @@ const userService = {
apiClient.post(endpoints.USER.ADD_CHUNK, data),
deleteChunk: (docId: string, chunkId: string): Promise<any> =>
apiClient.delete(endpoints.USER.DELETE_CHUNK(docId, chunkId)),
updateChunk: (data: any): Promise<any> =>
apiClient.put(endpoints.USER.UPDATE_CHUNK, data),
};
export default userService;