fix(journey-editor): unsaved-warning banner + save throws on failure

JourneyEditor now renders UnsavedWarningBanner when showUnsavedWarning
is true. save() wraps onSubmit in try/catch so clearOnSuccess only fires
on success. edit/+page.svelte handleSubmit throws instead of returning
on non-ok responses so JourneyEditor sees the failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-10 19:36:18 +02:00
parent 74b94ccd84
commit c3afd57e19
3 changed files with 83 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ async function handleSubmit(payload: {
if (!res.ok) {
const code = (await res.json().catch(() => ({})))?.code;
errorMessage = getErrorMessage(code);
return;
throw new Error('save failed');
}
goto(`/geschichten/${data.geschichte.id}`);
} finally {