🏺 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:
Danny Avila 2026-01-02 19:41:53 -05:00 committed by GitHub
parent cda6d589d6
commit b94388ce9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 167 additions and 2 deletions

View file

@ -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> {