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:
@@ -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()
|
||||
})()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user