fix: bad error check

This commit is contained in:
Oliver Bryan
2025-12-31 18:54:34 +00:00
parent 8b6dad8a2a
commit 435540f158

View File

@@ -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);
} }
} }