diff --git a/resources/js/components/SMForm.vue b/resources/js/components/SMForm.vue index 88c9bbc..b16757c 100644 --- a/resources/js/components/SMForm.vue +++ b/resources/js/components/SMForm.vue @@ -22,7 +22,7 @@ const props = defineProps({ required: true, }, }); -const emits = defineEmits(["submit"]); +const emits = defineEmits(["submit", "failedValidation"]); /** * Handle the user submitting the form. @@ -30,6 +30,8 @@ const emits = defineEmits(["submit"]); const handleSubmit = async function () { if (await props.modelValue.validate()) { emits("submit"); + } else { + emits("failedValidation"); } }; diff --git a/resources/js/views/dashboard/EventEdit.vue b/resources/js/views/dashboard/EventEdit.vue index 1774004..9cb89d0 100644 --- a/resources/js/views/dashboard/EventEdit.vue +++ b/resources/js/views/dashboard/EventEdit.vue @@ -5,7 +5,10 @@ class="sm-page-event-edit">