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.
This commit is contained in:
Usman Baig
2026-03-15 12:23:05 +01:00
parent e8f00e06ec
commit 9528eca443

View File

@@ -339,6 +339,10 @@ async function apiRequest<T>(
throw new ApiError(message, response.status, errorBody)
}
if (response.status === 204) {
return undefined as T
}
return response.json()
})()