diff --git a/src/lib/api/facility-admin.ts b/src/lib/api/facility-admin.ts index e374f5d..cdb6e1a 100644 --- a/src/lib/api/facility-admin.ts +++ b/src/lib/api/facility-admin.ts @@ -33,6 +33,11 @@ import apiFetch from '@/src/utils/apiFetch'; */ async function handleApiResponse(response: Response): Promise> { if (response.ok) { + // Handle 204 No Content - DELETE endpoints return empty body + if (response.status === 204) { + return { success: true, data: undefined as T }; + } + const json = await response.json(); // Flask returns { status: 'success', data: {...} } // Extract the actual data from the wrapper