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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user