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:
@@ -166,13 +166,9 @@ export default function GerbilFormPage() {
|
||||
genotype: nn(form.genotype),
|
||||
notes: nn(form.notes),
|
||||
}
|
||||
try {
|
||||
const saved = await mutation.run(body)
|
||||
navigate(`/rennmaeuse/${saved.id}`)
|
||||
} catch {
|
||||
// Error is surfaced via mutation.error; swallow so the rejected promise
|
||||
// from this async submit handler doesn't become an unhandled rejection.
|
||||
}
|
||||
const result = await mutation.run(body)
|
||||
if (result.ok) navigate(`/rennmaeuse/${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