diff --git a/client/src/api.js b/client/src/api.js index 4e3d320..932f9cc 100644 --- a/client/src/api.js +++ b/client/src/api.js @@ -8,8 +8,8 @@ async function request(method, url, body) { const text = await res.text().catch(() => ''); throw new Error(`${method} ${url} fehlgeschlagen: ${res.status} ${text}`); } - if (res.status === 204) return null; - return res.json(); + const text = await res.text(); + return text ? JSON.parse(text) : null; } export const api = {