weiterer fortschritt mit tamagui und dem neuen mobile event admin

This commit is contained in:
Codex Agent
2025-12-10 20:01:47 +01:00
parent 73e550ee87
commit 7b01a77083
26 changed files with 761 additions and 139 deletions

View File

@@ -65,10 +65,13 @@ export async function createGiftVoucherCheckout(data: GiftVoucherCheckoutRequest
const payload = await response.json().catch(() => ({}));
if (!response.ok) {
const message =
(payload?.errors && typeof payload.errors === 'object' && Object.values(payload.errors)[0]?.[0]) ||
payload?.message ||
'Unable to start checkout';
const errors = (payload?.errors ?? {}) as Record<string, unknown>;
const firstErrorEntry = Object.values(errors)[0];
const firstError =
Array.isArray(firstErrorEntry) && typeof firstErrorEntry[0] === 'string'
? firstErrorEntry[0]
: null;
const message = firstError || (typeof payload?.message === 'string' ? payload.message : null) || 'Unable to start checkout';
throw new Error(message);
}