fix(todos): handleResponse gère 204 No Content (suppression sans SyntaxError)

This commit is contained in:
2026-05-24 12:37:03 +02:00
parent 2e1f3a77fb
commit 9d852c3bf1
+1
View File
@@ -53,6 +53,7 @@ const BASE = '/api/todos'
async function handleResponse<T>(res: Response): Promise<T> {
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`)
if (res.status === 204) return undefined as T
return res.json() as Promise<T>
}