From bafa39d3965351c09139da8ca0643fbce9ecb1b7 Mon Sep 17 00:00:00 2001 From: Michael Bauer <michael-bauer@posteo.de> Date: Thu, 13 Jun 2024 19:54:57 +0200 Subject: [PATCH] Update absence-creation-dialog's success handling --- .../absences/AbsenceCreationDialog.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue index 079d6af7a..d1b848c4f 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/AbsenceCreationDialog.vue @@ -104,6 +104,13 @@ export default { this.popup = false; this.form = true; }, + clearForm() { + this.persons = []; + this.startDate = ""; + this.endDate = ""; + this.comment = ""; + this.absenceReason = ""; + }, confirm() { this.handleLoading(true); this.$apollo.mutate( { @@ -117,13 +124,9 @@ export default { }, }) .then(() => { - this.persons = []; - this.startDate = ""; - this.endDate = ""; - this.comment = ""; - this.absenceReason = ""; - this.popup = false; - $toastSuccess("alsijil.coursebook.absences.success"); + this.clearForm() + this.cancel(); + this.$toastSuccess("alsijil.coursebook.absences.success"); }) .catch((error) => { this.popup = false; -- GitLab