From b23ff9406083c8f47b4e17ba6d37580f30c649f4 Mon Sep 17 00:00:00 2001 From: pjaudiomv <34245618+pjaudiomv@users.noreply.github.com> Date: Sun, 10 Nov 2024 12:58:12 -0500 Subject: [PATCH] dirty form fix (#1129) --- .../js/components/MeetingEditForm.svelte | 75 ++++++++++--------- src/resources/js/lib/utils.ts | 5 ++ 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/src/resources/js/components/MeetingEditForm.svelte b/src/resources/js/components/MeetingEditForm.svelte index 836345467..8a508d2ca 100644 --- a/src/resources/js/components/MeetingEditForm.svelte +++ b/src/resources/js/components/MeetingEditForm.svelte @@ -150,7 +150,10 @@ trainLines: selectedMeeting?.trainLines ?? '', comments: selectedMeeting?.comments ?? '', customFields: selectedMeeting?.customFields - ? { ...Object.fromEntries(globalSettings.customFields.map((field) => [field.name, ''])), ...selectedMeeting.customFields } + ? { + ...Object.fromEntries(globalSettings.customFields.map((field) => [field.name, ''])), + ...Object.fromEntries(Object.entries(selectedMeeting.customFields).map(([key, value]) => [key, value ?? ''])) + } : Object.fromEntries(globalSettings.customFields.map((field) => [field.name, ''])) }; let latitude = initialValues.latitude; @@ -615,7 +618,7 @@