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