diff --git a/resources/js/components/SMForm.vue b/resources/js/components/SMForm.vue index f21e56a..d36d39a 100644 --- a/resources/js/components/SMForm.vue +++ b/resources/js/components/SMForm.vue @@ -30,7 +30,7 @@ watch( if (!status) { enableFormInputs(); } - } + }, ); /** @@ -49,7 +49,9 @@ const handleSubmit = async function () { } if (await props.modelValue.validate()) { - emits("submit"); + emits("submit", () => { + enableFormInputs(); + }); } else { emits("failedValidation"); enableFormInputs(); diff --git a/resources/js/views/dashboard/ArticleEdit.vue b/resources/js/views/dashboard/ArticleEdit.vue index d6d1b4b..d8252d0 100644 --- a/resources/js/views/dashboard/ArticleEdit.vue +++ b/resources/js/views/dashboard/ArticleEdit.vue @@ -197,7 +197,7 @@ const loadData = async () => { } }; -const handleSubmit = async () => { +const handleSubmit = async (enableFormCallBack) => { try { let data = { title: form.controls.title.value, @@ -258,6 +258,7 @@ const handleSubmit = async () => { type: "danger", }); }); + enableFormCallBack(); } }; diff --git a/resources/js/views/dashboard/EventEdit.vue b/resources/js/views/dashboard/EventEdit.vue index be7a9df..953e81d 100644 --- a/resources/js/views/dashboard/EventEdit.vue +++ b/resources/js/views/dashboard/EventEdit.vue @@ -303,7 +303,7 @@ const loadData = async () => { } }; -const handleSubmit = async () => { +const handleSubmit = async (enableFormCallBack) => { try { let data = { title: form.controls.title.value, @@ -376,6 +376,7 @@ const handleSubmit = async () => { content: "An error occurred saving the event.", type: "danger", }); + enableFormCallBack(); } }; diff --git a/resources/js/views/dashboard/MediaEdit.vue b/resources/js/views/dashboard/MediaEdit.vue index 5c1adc3..60b376a 100644 --- a/resources/js/views/dashboard/MediaEdit.vue +++ b/resources/js/views/dashboard/MediaEdit.vue @@ -12,7 +12,10 @@ @submit="handleSubmit" @failed-validation="handleFailValidation">