HOTFIX: useMutation.run returns MutationOutcome (no throw); sweep all 7 call sites + README convention

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 00:44:56 +02:00
parent 3476b71525
commit 27299e225c
8 changed files with 54 additions and 40 deletions

View File

@@ -116,13 +116,9 @@ export default function WurfFormPage() {
expectedGoHomeDate: nn(form.expectedGoHomeDate),
notes: nn(form.notes),
}
try {
const saved = await mutation.run(body)
navigate(`/wuerfe/${saved.id}`)
} catch {
// Error surfaced via mutation.error; swallow to avoid an unhandled
// rejection escaping this async submit handler.
}
const result = await mutation.run(body)
if (result.ok) navigate(`/wuerfe/${result.value.id}`)
// On failure mutation.error drives the inline alert; run() never throws.
}
if (isEdit && existing.loading) return <p className="muted">{de.common.loading}</p>