mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
fix: bad error check
This commit is contained in:
@@ -17,14 +17,9 @@ export async function byUser({
|
|||||||
|
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const error = await res.text();
|
const error = await res.text();
|
||||||
onError?.(error || `failed to create organisation (${res.status})`);
|
onError?.(error || `failed to get organisations (${res.status})`);
|
||||||
} else {
|
} else {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (!data.id) {
|
|
||||||
onError?.(`failed to create organisation (${res.status})`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
onSuccess?.(data, res);
|
onSuccess?.(data, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user