frontend: fix error for 204 response

This commit is contained in:
hippoz 2022-04-26 23:57:06 +03:00
parent b72a445e97
commit 1f800b6d4c
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -27,7 +27,7 @@ export default async function(method, endpoint, auth=true, body=null) {
const res = await fetch(endpoint, options);
return {
success: true,
json: await res.json(),
json: res.status === 204 ? null : await res.json(),
ok: res.ok,
status: res.status
}