mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-10 04:28:50 +01:00
🏺 fix: Restore Archive Functionality with Dedicated Endpoint (#11183)
The archive conversation feature was broken after the `/api/convos/update`
route was modified to only handle title updates. The frontend was sending
`{ conversationId, isArchived }` to the update endpoint, but the backend
was only extracting `title` and ignoring the `isArchived` field entirely.
This fix implements a dedicated `/api/convos/archive` endpoint to restore
the archive/unarchive functionality.
Changes:
packages/data-provider/src/api-endpoints.ts:
- Add `archiveConversation()` endpoint returning `/api/convos/archive`
packages/data-provider/src/data-service.ts:
- Update `archiveConversation()` to use dedicated archive endpoint
api/server/routes/convos.js:
- Add `POST /archive` route with validation for `conversationId` (required)
and `isArchived` (must be boolean)
api/server/routes/__tests__/convos.spec.js:
- Add test coverage for archive endpoint (success, validation, error cases)
This commit is contained in:
parent
cda6d589d6
commit
b94388ce9d
4 changed files with 167 additions and 2 deletions
|
|
@ -108,6 +108,8 @@ export const genTitle = (conversationId: string) =>
|
|||
|
||||
export const updateConversation = () => `${conversationsRoot}/update`;
|
||||
|
||||
export const archiveConversation = () => `${conversationsRoot}/archive`;
|
||||
|
||||
export const deleteConversation = () => `${conversationsRoot}`;
|
||||
|
||||
export const deleteAllConversation = () => `${conversationsRoot}/all`;
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@ export function updateConversation(
|
|||
export function archiveConversation(
|
||||
payload: t.TArchiveConversationRequest,
|
||||
): Promise<t.TArchiveConversationResponse> {
|
||||
return request.post(endpoints.updateConversation(), { arg: payload });
|
||||
return request.post(endpoints.archiveConversation(), { arg: payload });
|
||||
}
|
||||
|
||||
export function genTitle(payload: m.TGenTitleRequest): Promise<m.TGenTitleResponse> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue