From b98770c938756549a00144cee1fcaa6b55c8585e Mon Sep 17 00:00:00 2001 From: xarmian Date: Mon, 6 Jul 2026 14:10:33 +0000 Subject: [PATCH] feat(web): add workspaces.restore + listDeleted API client methods Wire the web TypeScript API client to the TASK-1970 restore endpoints: - workspaces.restore(slug) -> POST /workspaces/{slug}/restore, returns the restored Workspace. - workspaces.listDeleted() -> GET /workspaces/deleted, returns DeletedWorkspace[] (Workspace + purge_at + days_left). Uses the shared request() helper and the existing DeletedWorkspace type (no redefinition). The restore UI that consumes these lands in TASK-1974/1975/1976. Closes TASK-1971 Claude-Session: https://claude.ai/code/session_01HxBkAMiFBtCRJ2tKSCt3ST --- web/src/lib/api/client.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/src/lib/api/client.ts b/web/src/lib/api/client.ts index 528b204e..364e63db 100644 --- a/web/src/lib/api/client.ts +++ b/web/src/lib/api/client.ts @@ -1,5 +1,6 @@ import type { Workspace, + DeletedWorkspace, WorkspaceCreate, WorkspaceUpdate, Collection, @@ -615,6 +616,17 @@ export const api = { delete: (slug: string) => request(`/workspaces/${slug}`, { method: 'DELETE' }), + // restore un-deletes a soft-deleted workspace that's still inside the + // purge window, returning the restored Workspace. Mirrors + // POST /workspaces/{slug}/restore (TASK-1970). + restore: (slug: string) => + request(`/workspaces/${slug}/restore`, { method: 'POST' }), + + // listDeleted returns the caller's soft-deleted workspaces still inside + // the restore window, each with purge_at + days_left. Backs the + // restore UI (GET /workspaces/deleted, TASK-1970). + listDeleted: () => request('/workspaces/deleted'), + reorder: (updates: { slug: string; sort_order: number }[]) => request('/workspaces/reorder', { method: 'PUT',