From a7d84c0a60300f8f417c593022e84fa91817670a Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Mon, 19 Aug 2024 16:44:33 -0400 Subject: [PATCH] chore: Fix null values for adventure date and end date in AdventureModal and EditTransportation --- frontend/src/lib/components/EditTransportation.svelte | 2 +- frontend/src/lib/components/NewCollection.svelte | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/EditTransportation.svelte b/frontend/src/lib/components/EditTransportation.svelte index fa17dd5..8d28771 100644 --- a/frontend/src/lib/components/EditTransportation.svelte +++ b/frontend/src/lib/components/EditTransportation.svelte @@ -164,7 +164,7 @@

diff --git a/frontend/src/lib/components/NewCollection.svelte b/frontend/src/lib/components/NewCollection.svelte index a69f2ea..3838895 100644 --- a/frontend/src/lib/components/NewCollection.svelte +++ b/frontend/src/lib/components/NewCollection.svelte @@ -47,6 +47,12 @@ return; } + // make sure end date has a start date + if (newCollection.end_date && !newCollection.start_date) { + addToast('error', 'Please provide a start date'); + return; + } + const response = await fetch(form.action, { method: form.method, body: formData