From aa7f11cb97a04e0f6e63f223eccead682b9da672 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Sat, 17 Jan 2026 23:11:23 -0500 Subject: [PATCH] implemented submission guard for promotion form --- ui/src/components/promotions/promotionForm.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/src/components/promotions/promotionForm.vue b/ui/src/components/promotions/promotionForm.vue index a6708f6..4e614ce 100644 --- a/ui/src/components/promotions/promotionForm.vue +++ b/ui/src/components/promotions/promotionForm.vue @@ -31,8 +31,12 @@ const { handleSubmit, errors, values, resetForm, setFieldValue, submitCount } = validateOnMount: false, }) +const submitting = ref(false); + const submitForm = handleSubmit( async (vals) => { + if (submitting.value) return; + submitting.value = true; try { let output = vals; output.promotions.map(p => p.start_date = new Date(p.start_date).toISOString()) @@ -42,6 +46,8 @@ const submitForm = handleSubmit( } catch (error) { submitError.value = error; console.error(error); + } finally { + submitting.value = false; } } ); @@ -281,7 +287,12 @@ function setAllToday() {
- +

{{ submitError }}