fix(timeline): preserve date/precision/end across a fail(400)

preservedFormFields echoed back only title/type/description/pickers, and
EventForm seeded dateIso/precision/endDateIso solely from `event` (undefined
on /new). So a no-JS validation-error reload silently dropped the entire
When-section the curator had entered, while every other field survived.

Echo eventDate/precision/eventDateEnd in the fail payload and seed the date
controls from `form` ahead of `event`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-14 09:06:21 +02:00
parent 4d5fa7a26f
commit 9f2ae7bd2e
4 changed files with 51 additions and 3 deletions

View File

@@ -90,6 +90,11 @@ export function preservedFormFields(parsed: ParsedEventForm) {
title: parsed.title,
description: parsed.description,
type: parsed.type,
// The When-section too, so a no-JS full reload re-seeds the date controls
// instead of dropping the curator's date/precision/end-date.
eventDate: parsed.eventDate,
precision: parsed.precision,
eventDateEnd: parsed.eventDateEnd,
personIds: parsed.personIds,
documentIds: parsed.documentIds
};