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