From c333c82c6bdbf270f80924468f123be05fb99e0b Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 23 Feb 2026 17:02:35 -0500 Subject: [PATCH] fix(frontend): add data parameter support to apiDelete - Add optional data parameter to apiDelete() with generic type safety - Enables DELETE requests with request bodies (needed for folder deletion) - 100% backward compatible (optional parameter) - Supports type-safe request body passing Part of: Issue 1 --- web/src/api.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/api.ts b/web/src/api.ts index 015c271..9817108 100644 --- a/web/src/api.ts +++ b/web/src/api.ts @@ -34,12 +34,14 @@ async function apiPut(url: string, data?: unknown): Promise { }); } -async function apiDelete(url: string): Promise { +async function apiDelete(url: string, data?: T): Promise { return fetch(`/api${url}`, { method: 'DELETE', headers: { - 'Authorization': getAuthHeader() - } + 'Authorization': getAuthHeader(), + 'Content-Type': 'application/json' + }, + body: data ? JSON.stringify(data) : undefined }); }