From 9528eca443ed2b85a22b7c53a9dca8e4961f85ee Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sun, 15 Mar 2026 12:23:05 +0100 Subject: [PATCH] fix: handle 204 No Content responses in API client Prevent error toasts on successful delete operations by checking for 204 status before attempting to parse response body as JSON. --- lib/api/client.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/api/client.ts b/lib/api/client.ts index 6362b8c..5014fc5 100644 --- a/lib/api/client.ts +++ b/lib/api/client.ts @@ -339,6 +339,10 @@ async function apiRequest( throw new ApiError(message, response.status, errorBody) } + if (response.status === 204) { + return undefined as T + } + return response.json() })()