From 0ee5a92c95a01a44dda06d9f3c4cb20e83aed90b Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Mon, 13 Jan 2025 10:24:03 +0100 Subject: [PATCH] fix: dialog status handling --- .../admin/club/calendar/CreateCalendarModal.vue | 7 ++----- .../admin/club/calendar/DeleteCalendarModal.vue | 5 ++++- .../admin/club/calendar/UpdateCalendarModal.vue | 7 ++----- src/components/admin/club/member/CreateMemberModal.vue | 1 + src/components/admin/club/member/DeleteMemberModal.vue | 1 + .../admin/club/member/MemberAwardCreateModal.vue | 1 + .../admin/club/member/MemberAwardDeleteModal.vue | 1 + src/components/admin/club/member/MemberAwardEditModal.vue | 5 ++++- .../admin/club/member/MemberCommunicationCreateModal.vue | 1 + .../admin/club/member/MemberCommunicationDeleteModal.vue | 1 + .../admin/club/member/MemberCommunicationEditModal.vue | 5 ++++- .../club/member/MemberExecutivePositionCreateModal.vue | 1 + .../club/member/MemberExecutivePositionDeleteModal.vue | 1 + .../club/member/MemberExecutivePositionEditModal.vue | 5 ++++- .../admin/club/member/MemberQualificationCreateModal.vue | 1 + .../admin/club/member/MemberQualificationDeleteModal.vue | 1 + .../admin/club/member/MemberQualificationEditModal.vue | 5 ++++- .../admin/club/member/MembershipCreateModal.vue | 1 + .../admin/club/member/MembershipDeleteModal.vue | 1 + src/components/admin/club/member/MembershipEditModal.vue | 5 ++++- .../admin/club/newsletter/CreateNewsletterModal.vue | 1 + .../admin/club/protocol/CreateProtocolModal.vue | 1 + src/components/admin/settings/award/CreateAwardModal.vue | 5 ++++- src/components/admin/settings/award/DeleteAwardModal.vue | 5 ++++- .../settings/calendarType/CreateCalendarTypeModal.vue | 7 ++----- .../settings/calendarType/DeleteCalendarTypeModal.vue | 5 ++++- .../communicationType/CreateCommunicationTypeModal.vue | 5 ++++- .../communicationType/DeleteCommunicationTypeModal.vue | 5 ++++- .../executivePosition/CreateExecutivePositionModal.vue | 5 ++++- .../executivePosition/DeleteExecutivePositionModal.vue | 5 ++++- .../membershipStatus/CreateMembershipStatusModal.vue | 5 ++++- .../membershipStatus/DeleteMembershipStatusModal.vue | 5 ++++- .../settings/qualification/CreateQualificationModal.vue | 5 ++++- .../settings/qualification/DeleteQualificationModal.vue | 5 ++++- .../admin/settings/queryStore/CreateQueryStoreModal.vue | 5 ++++- .../admin/settings/queryStore/DeleteQueryStoreModal.vue | 5 ++++- .../admin/settings/queryStore/UpdateQueryStoreModal.vue | 5 ++++- .../admin/settings/template/CreateTemplateModal.vue | 5 ++++- .../admin/settings/template/DeleteTemplateModal.vue | 5 ++++- src/components/admin/user/role/CreateRoleModal.vue | 5 ++++- src/components/admin/user/role/DeleteRoleModal.vue | 5 ++++- src/components/admin/user/user/DeleteUserModal.vue | 5 ++++- src/components/admin/user/user/InviteUserModal.vue | 8 +++++--- src/serverCom.ts | 6 +++++- 44 files changed, 130 insertions(+), 44 deletions(-) diff --git a/src/components/admin/club/calendar/CreateCalendarModal.vue b/src/components/admin/club/calendar/CreateCalendarModal.vue index 5b068a9..7cef3bc 100644 --- a/src/components/admin/club/calendar/CreateCalendarModal.vue +++ b/src/components/admin/club/calendar/CreateCalendarModal.vue @@ -124,11 +124,7 @@
-
@@ -194,6 +190,7 @@ export default defineComponent({ location: formData.location.value, allDay: this.allDay, }; + this.status = "loading"; this.createCalendar(createCalendar) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/calendar/DeleteCalendarModal.vue b/src/components/admin/club/calendar/DeleteCalendarModal.vue index 368b51b..dba35d6 100644 --- a/src/components/admin/club/calendar/DeleteCalendarModal.vue +++ b/src/components/admin/club/calendar/DeleteCalendarModal.vue @@ -38,7 +38,9 @@
- +
@@ -78,6 +80,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useCalendarStore, ["deleteCalendar"]), triggerDelete() { + this.status = "loading"; this.deleteCalendar(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/calendar/UpdateCalendarModal.vue b/src/components/admin/club/calendar/UpdateCalendarModal.vue index 499adda..4def617 100644 --- a/src/components/admin/club/calendar/UpdateCalendarModal.vue +++ b/src/components/admin/club/calendar/UpdateCalendarModal.vue @@ -166,11 +166,7 @@
-
@@ -264,6 +260,7 @@ export default defineComponent({ location: formData.location.value, allDay: this.calendar.allDay, }; + this.status = "loading"; this.updateCalendar(updateCalendar) .then(() => { this.fetchItem(); diff --git a/src/components/admin/club/member/CreateMemberModal.vue b/src/components/admin/club/member/CreateMemberModal.vue index 177f4af..0436dd5 100644 --- a/src/components/admin/club/member/CreateMemberModal.vue +++ b/src/components/admin/club/member/CreateMemberModal.vue @@ -133,6 +133,7 @@ export default defineComponent({ birthdate: formData.birthdate.value, internalId: formData.internalId.value, }; + this.status = "loading"; this.createMember(createMember) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/DeleteMemberModal.vue b/src/components/admin/club/member/DeleteMemberModal.vue index 2852777..5f562dc 100644 --- a/src/components/admin/club/member/DeleteMemberModal.vue +++ b/src/components/admin/club/member/DeleteMemberModal.vue @@ -72,6 +72,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useMemberStore, ["deleteMember"]), triggerDelete() { + this.status = "loading"; this.deleteMember(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberAwardCreateModal.vue b/src/components/admin/club/member/MemberAwardCreateModal.vue index 34a123c..b0ac1ad 100644 --- a/src/components/admin/club/member/MemberAwardCreateModal.vue +++ b/src/components/admin/club/member/MemberAwardCreateModal.vue @@ -140,6 +140,7 @@ export default defineComponent({ given: formData.given.checked, awardId: this.selectedAward.id, }; + this.status = "loading"; this.createMemberAward(createMemberAward) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberAwardDeleteModal.vue b/src/components/admin/club/member/MemberAwardDeleteModal.vue index 7fcdd3f..bb878e5 100644 --- a/src/components/admin/club/member/MemberAwardDeleteModal.vue +++ b/src/components/admin/club/member/MemberAwardDeleteModal.vue @@ -65,6 +65,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useMemberAwardStore, ["deleteMemberAward"]), triggerDelete() { + this.status = "loading"; this.deleteMemberAward(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberAwardEditModal.vue b/src/components/admin/club/member/MemberAwardEditModal.vue index 1523f47..e21b7e5 100644 --- a/src/components/admin/club/member/MemberAwardEditModal.vue +++ b/src/components/admin/club/member/MemberAwardEditModal.vue @@ -83,7 +83,9 @@
- +
@@ -167,6 +169,7 @@ export default defineComponent({ given: formData.given.checked, awardId: this.memberAward.awardId, }; + this.status = "loading"; this.updateMemberAward(updateMemberAward) .then(() => { this.fetchItem(); diff --git a/src/components/admin/club/member/MemberCommunicationCreateModal.vue b/src/components/admin/club/member/MemberCommunicationCreateModal.vue index cac1e8f..ecb2fe7 100644 --- a/src/components/admin/club/member/MemberCommunicationCreateModal.vue +++ b/src/components/admin/club/member/MemberCommunicationCreateModal.vue @@ -175,6 +175,7 @@ export default defineComponent({ isSMSAlarming: formData.isSMSAlarming?.checked, typeId: this.selectedCommunicationType.id, }; + this.status = "loading"; this.createCommunication(createCommunication) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberCommunicationDeleteModal.vue b/src/components/admin/club/member/MemberCommunicationDeleteModal.vue index 51fc2a9..bbf8dcd 100644 --- a/src/components/admin/club/member/MemberCommunicationDeleteModal.vue +++ b/src/components/admin/club/member/MemberCommunicationDeleteModal.vue @@ -68,6 +68,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useCommunicationStore, ["deleteCommunication"]), triggerDelete() { + this.status = "loading"; this.deleteCommunication(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberCommunicationEditModal.vue b/src/components/admin/club/member/MemberCommunicationEditModal.vue index b674c00..4d5dc85 100644 --- a/src/components/admin/club/member/MemberCommunicationEditModal.vue +++ b/src/components/admin/club/member/MemberCommunicationEditModal.vue @@ -62,7 +62,9 @@
- +
@@ -144,6 +146,7 @@ export default defineComponent({ isNewsletterMain: formData.isNewsletterMain.checked, isSMSAlarming: formData.isSMSAlarming?.checked, }; + this.status = "loading"; this.updateCommunication(updateCommunication) .then(() => { this.fetchItem(); diff --git a/src/components/admin/club/member/MemberExecutivePositionCreateModal.vue b/src/components/admin/club/member/MemberExecutivePositionCreateModal.vue index 5c4ef8e..0975057 100644 --- a/src/components/admin/club/member/MemberExecutivePositionCreateModal.vue +++ b/src/components/admin/club/member/MemberExecutivePositionCreateModal.vue @@ -141,6 +141,7 @@ export default defineComponent({ note: formData.note.value, executivePositionId: this.selectedExecutivePosition.id, }; + this.status = "loading"; this.createMemberExecutivePosition(createMemberExecutivePosition) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberExecutivePositionDeleteModal.vue b/src/components/admin/club/member/MemberExecutivePositionDeleteModal.vue index 7009b6d..cb0cb8e 100644 --- a/src/components/admin/club/member/MemberExecutivePositionDeleteModal.vue +++ b/src/components/admin/club/member/MemberExecutivePositionDeleteModal.vue @@ -65,6 +65,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useMemberExecutivePositionStore, ["deleteMemberExecutivePosition"]), triggerDelete() { + this.status = "loading"; this.deleteMemberExecutivePosition(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberExecutivePositionEditModal.vue b/src/components/admin/club/member/MemberExecutivePositionEditModal.vue index 00f09dd..f3a4e4d 100644 --- a/src/components/admin/club/member/MemberExecutivePositionEditModal.vue +++ b/src/components/admin/club/member/MemberExecutivePositionEditModal.vue @@ -89,7 +89,9 @@
- +
@@ -176,6 +178,7 @@ export default defineComponent({ note: formData.note.value, executivePositionId: this.memberExecutivePosition.executivePositionId, }; + this.status = "loading"; this.updateMemberExecutivePosition(updateMemberExecutivePosition) .then(() => { this.fetchItem(); diff --git a/src/components/admin/club/member/MemberQualificationCreateModal.vue b/src/components/admin/club/member/MemberQualificationCreateModal.vue index 86690ff..9566636 100644 --- a/src/components/admin/club/member/MemberQualificationCreateModal.vue +++ b/src/components/admin/club/member/MemberQualificationCreateModal.vue @@ -148,6 +148,7 @@ export default defineComponent({ note: formData.note.value, qualificationId: this.selectedQualification.id, }; + this.status = "loading"; this.createMemberQualification(createMemberQualification) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberQualificationDeleteModal.vue b/src/components/admin/club/member/MemberQualificationDeleteModal.vue index fa3f694..260713b 100644 --- a/src/components/admin/club/member/MemberQualificationDeleteModal.vue +++ b/src/components/admin/club/member/MemberQualificationDeleteModal.vue @@ -69,6 +69,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useMemberQualificationStore, ["deleteMemberQualification"]), triggerDelete() { + this.status = "loading"; this.deleteMemberQualification(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MemberQualificationEditModal.vue b/src/components/admin/club/member/MemberQualificationEditModal.vue index db203c7..8c38b67 100644 --- a/src/components/admin/club/member/MemberQualificationEditModal.vue +++ b/src/components/admin/club/member/MemberQualificationEditModal.vue @@ -90,7 +90,9 @@
- +
@@ -175,6 +177,7 @@ export default defineComponent({ terminationReason: formData.terminationReason.value, qualificationId: this.memberQualification.qualificationId, }; + this.status = "loading"; this.updateMemberQualification(updateMemberQualification) .then(() => { this.fetchItem(); diff --git a/src/components/admin/club/member/MembershipCreateModal.vue b/src/components/admin/club/member/MembershipCreateModal.vue index 0bda496..b7372f9 100644 --- a/src/components/admin/club/member/MembershipCreateModal.vue +++ b/src/components/admin/club/member/MembershipCreateModal.vue @@ -131,6 +131,7 @@ export default defineComponent({ start: formData.start.value, statusId: this.selectedStatus.id, }; + this.status = "loading"; this.createMembership(createMember) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MembershipDeleteModal.vue b/src/components/admin/club/member/MembershipDeleteModal.vue index a9fdf0d..6ccc6ae 100644 --- a/src/components/admin/club/member/MembershipDeleteModal.vue +++ b/src/components/admin/club/member/MembershipDeleteModal.vue @@ -67,6 +67,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useMembershipStore, ["deleteMembership"]), triggerDelete() { + this.status = "loading"; this.deleteMembership(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/member/MembershipEditModal.vue b/src/components/admin/club/member/MembershipEditModal.vue index 7d93b43..2b05623 100644 --- a/src/components/admin/club/member/MembershipEditModal.vue +++ b/src/components/admin/club/member/MembershipEditModal.vue @@ -86,7 +86,9 @@
- +
@@ -170,6 +172,7 @@ export default defineComponent({ terminationReason: formData.terminationReason.value, statusId: this.membership.statusId, }; + this.status = "loading"; this.updateMembership(updateMembership) .then(() => { this.fetchItem(); diff --git a/src/components/admin/club/newsletter/CreateNewsletterModal.vue b/src/components/admin/club/newsletter/CreateNewsletterModal.vue index 8948a70..f589b89 100644 --- a/src/components/admin/club/newsletter/CreateNewsletterModal.vue +++ b/src/components/admin/club/newsletter/CreateNewsletterModal.vue @@ -61,6 +61,7 @@ export default defineComponent({ let createNewsletter: CreateNewsletterViewModel = { title: formData.title.value, }; + this.status = "loading"; this.createNewsletter(createNewsletter) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/club/protocol/CreateProtocolModal.vue b/src/components/admin/club/protocol/CreateProtocolModal.vue index f49a50f..efa2e50 100644 --- a/src/components/admin/club/protocol/CreateProtocolModal.vue +++ b/src/components/admin/club/protocol/CreateProtocolModal.vue @@ -64,6 +64,7 @@ export default defineComponent({ title: formData.title.value, date: formData.date.value, }; + this.status = "loading"; this.createProtocol(createProtocol) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/award/CreateAwardModal.vue b/src/components/admin/settings/award/CreateAwardModal.vue index 6daeff0..a2ae0fb 100644 --- a/src/components/admin/settings/award/CreateAwardModal.vue +++ b/src/components/admin/settings/award/CreateAwardModal.vue @@ -19,7 +19,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ let createAward: CreateAwardViewModel = { award: formData.award.value, }; + this.status = "loading"; this.createAward(createAward) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/award/DeleteAwardModal.vue b/src/components/admin/settings/award/DeleteAwardModal.vue index c3a1e6a..2f59002 100644 --- a/src/components/admin/settings/award/DeleteAwardModal.vue +++ b/src/components/admin/settings/award/DeleteAwardModal.vue @@ -16,7 +16,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useAwardStore, ["deleteAward"]), triggerDelete() { + this.status = "loading"; this.deleteAward(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/calendarType/CreateCalendarTypeModal.vue b/src/components/admin/settings/calendarType/CreateCalendarTypeModal.vue index b35a897..4e83c1b 100644 --- a/src/components/admin/settings/calendarType/CreateCalendarTypeModal.vue +++ b/src/components/admin/settings/calendarType/CreateCalendarTypeModal.vue @@ -32,11 +32,7 @@
-
@@ -82,6 +78,7 @@ export default defineComponent({ nscdr: formData.nscdr.checked, passphrase: formData.passphrase.value, }; + this.status = "loading"; this.createCalendarType(createCalendarType) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/calendarType/DeleteCalendarTypeModal.vue b/src/components/admin/settings/calendarType/DeleteCalendarTypeModal.vue index 46642ec..04186d6 100644 --- a/src/components/admin/settings/calendarType/DeleteCalendarTypeModal.vue +++ b/src/components/admin/settings/calendarType/DeleteCalendarTypeModal.vue @@ -16,7 +16,9 @@
- +
@@ -56,6 +58,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useCalendarTypeStore, ["deleteCalendarType"]), triggerDelete() { + this.status = "loading"; this.deleteCalendarType(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue b/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue index c9cf750..32929dc 100644 --- a/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue +++ b/src/components/admin/settings/communicationType/CreateCommunicationTypeModal.vue @@ -65,7 +65,9 @@
- +
@@ -114,6 +116,7 @@ export default defineComponent({ type: formData.communicationType.value, fields: this.selectedFields, }; + this.status = "loading"; this.createCommunicationType(createCommunicationType) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/communicationType/DeleteCommunicationTypeModal.vue b/src/components/admin/settings/communicationType/DeleteCommunicationTypeModal.vue index f9a18a3..d04aa14 100644 --- a/src/components/admin/settings/communicationType/DeleteCommunicationTypeModal.vue +++ b/src/components/admin/settings/communicationType/DeleteCommunicationTypeModal.vue @@ -16,7 +16,9 @@
- +
@@ -56,6 +58,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useCommunicationTypeStore, ["deleteCommunicationType"]), triggerDelete() { + this.status = "loading"; this.deleteCommunicationType(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/executivePosition/CreateExecutivePositionModal.vue b/src/components/admin/settings/executivePosition/CreateExecutivePositionModal.vue index c01cc47..411fd55 100644 --- a/src/components/admin/settings/executivePosition/CreateExecutivePositionModal.vue +++ b/src/components/admin/settings/executivePosition/CreateExecutivePositionModal.vue @@ -19,7 +19,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ let createExecutivePosition: CreateExecutivePositionViewModel = { position: formData.executivePosition.value, }; + this.status = "loading"; this.createExecutivePosition(createExecutivePosition) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/executivePosition/DeleteExecutivePositionModal.vue b/src/components/admin/settings/executivePosition/DeleteExecutivePositionModal.vue index 399bdcd..7099608 100644 --- a/src/components/admin/settings/executivePosition/DeleteExecutivePositionModal.vue +++ b/src/components/admin/settings/executivePosition/DeleteExecutivePositionModal.vue @@ -16,7 +16,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useExecutivePositionStore, ["deleteExecutivePosition"]), triggerDelete() { + this.status = "loading"; this.deleteExecutivePosition(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/membershipStatus/CreateMembershipStatusModal.vue b/src/components/admin/settings/membershipStatus/CreateMembershipStatusModal.vue index 8bbe3af..dffdf5c 100644 --- a/src/components/admin/settings/membershipStatus/CreateMembershipStatusModal.vue +++ b/src/components/admin/settings/membershipStatus/CreateMembershipStatusModal.vue @@ -19,7 +19,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ let createMembershipStatus: CreateMembershipStatusViewModel = { status: formData.membershipStatus.value, }; + this.status = "loading"; this.createMembershipStatus(createMembershipStatus) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/membershipStatus/DeleteMembershipStatusModal.vue b/src/components/admin/settings/membershipStatus/DeleteMembershipStatusModal.vue index 081727a..5868a8a 100644 --- a/src/components/admin/settings/membershipStatus/DeleteMembershipStatusModal.vue +++ b/src/components/admin/settings/membershipStatus/DeleteMembershipStatusModal.vue @@ -16,7 +16,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useMembershipStatusStore, ["deleteMembershipStatus"]), triggerDelete() { + this.status = "loading"; this.deleteMembershipStatus(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/qualification/CreateQualificationModal.vue b/src/components/admin/settings/qualification/CreateQualificationModal.vue index a70a710..c2ac0ab 100644 --- a/src/components/admin/settings/qualification/CreateQualificationModal.vue +++ b/src/components/admin/settings/qualification/CreateQualificationModal.vue @@ -23,7 +23,9 @@
- +
@@ -62,6 +64,7 @@ export default defineComponent({ qualification: formData.qualification.value, description: formData.description.value, }; + this.status = "loading"; this.createQualification(createQualification) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/qualification/DeleteQualificationModal.vue b/src/components/admin/settings/qualification/DeleteQualificationModal.vue index ffdb77b..011b132 100644 --- a/src/components/admin/settings/qualification/DeleteQualificationModal.vue +++ b/src/components/admin/settings/qualification/DeleteQualificationModal.vue @@ -16,7 +16,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useQualificationStore, ["deleteQualification"]), triggerDelete() { + this.status = "loading"; this.deleteQualification(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/queryStore/CreateQueryStoreModal.vue b/src/components/admin/settings/queryStore/CreateQueryStoreModal.vue index 485381a..7f27a9e 100644 --- a/src/components/admin/settings/queryStore/CreateQueryStoreModal.vue +++ b/src/components/admin/settings/queryStore/CreateQueryStoreModal.vue @@ -19,7 +19,9 @@
- +
@@ -62,6 +64,7 @@ export default defineComponent({ title: formData.title.value, query: this.query ?? "", }; + this.status = "loading"; this.createQueryStore(createAward) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/queryStore/DeleteQueryStoreModal.vue b/src/components/admin/settings/queryStore/DeleteQueryStoreModal.vue index eb50139..a623deb 100644 --- a/src/components/admin/settings/queryStore/DeleteQueryStoreModal.vue +++ b/src/components/admin/settings/queryStore/DeleteQueryStoreModal.vue @@ -16,7 +16,9 @@
- +
@@ -56,6 +58,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useQueryStoreStore, ["deleteQueryStore"]), triggerDelete() { + this.status = "loading"; this.deleteQueryStore(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/queryStore/UpdateQueryStoreModal.vue b/src/components/admin/settings/queryStore/UpdateQueryStoreModal.vue index a60b8b7..82b10f4 100644 --- a/src/components/admin/settings/queryStore/UpdateQueryStoreModal.vue +++ b/src/components/admin/settings/queryStore/UpdateQueryStoreModal.vue @@ -21,7 +21,9 @@
- +
@@ -73,6 +75,7 @@ export default defineComponent({ id: this.data, query: this.query ?? "", }; + this.status = "loading"; this.updateActiveQueryStore(updateQuery) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/template/CreateTemplateModal.vue b/src/components/admin/settings/template/CreateTemplateModal.vue index 14ddbdd..5319e57 100644 --- a/src/components/admin/settings/template/CreateTemplateModal.vue +++ b/src/components/admin/settings/template/CreateTemplateModal.vue @@ -23,7 +23,9 @@
- +
@@ -62,6 +64,7 @@ export default defineComponent({ template: formData.template.value, description: formData.description.value, }; + this.status = "loading"; this.createTemplate(createTemplate) .then((res) => { this.status = { status: "success" }; diff --git a/src/components/admin/settings/template/DeleteTemplateModal.vue b/src/components/admin/settings/template/DeleteTemplateModal.vue index 8bbf2ba..29ad5fa 100644 --- a/src/components/admin/settings/template/DeleteTemplateModal.vue +++ b/src/components/admin/settings/template/DeleteTemplateModal.vue @@ -16,7 +16,9 @@
- +
@@ -57,6 +59,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useTemplateStore, ["deleteTemplate"]), triggerDelete() { + this.status = "loading"; this.deleteTemplate(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/user/role/CreateRoleModal.vue b/src/components/admin/user/role/CreateRoleModal.vue index 87d9573..9699f9c 100644 --- a/src/components/admin/user/role/CreateRoleModal.vue +++ b/src/components/admin/user/role/CreateRoleModal.vue @@ -19,7 +19,9 @@
- +
@@ -53,6 +55,7 @@ export default defineComponent({ ...mapActions(useRoleStore, ["createRole"]), triggerCreateRole(e: any) { let formData = e.target.elements; + this.status = "loading"; this.createRole(formData.role.value) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/user/role/DeleteRoleModal.vue b/src/components/admin/user/role/DeleteRoleModal.vue index 764c487..eda8907 100644 --- a/src/components/admin/user/role/DeleteRoleModal.vue +++ b/src/components/admin/user/role/DeleteRoleModal.vue @@ -16,7 +16,9 @@
- +
@@ -56,6 +58,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useRoleStore, ["deleteRole"]), triggerDeleteRole() { + this.status = "loading"; this.deleteRole(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/user/user/DeleteUserModal.vue b/src/components/admin/user/user/DeleteUserModal.vue index 720a06f..fcd155a 100644 --- a/src/components/admin/user/user/DeleteUserModal.vue +++ b/src/components/admin/user/user/DeleteUserModal.vue @@ -16,7 +16,9 @@
- +
@@ -56,6 +58,7 @@ export default defineComponent({ ...mapActions(useModalStore, ["closeModal"]), ...mapActions(useUserStore, ["deleteUser"]), triggerDeleteUser() { + this.status = "loading"; this.deleteUser(this.data) .then(() => { this.status = { status: "success" }; diff --git a/src/components/admin/user/user/InviteUserModal.vue b/src/components/admin/user/user/InviteUserModal.vue index 9ea6d9f..7e46698 100644 --- a/src/components/admin/user/user/InviteUserModal.vue +++ b/src/components/admin/user/user/InviteUserModal.vue @@ -32,7 +32,9 @@
- +
@@ -70,13 +72,13 @@ export default defineComponent({ ...mapActions(useInviteStore, ["createInvite"]), invite(e: any) { let formData = e.target.elements; - this.status = "loading"; let createInvite: CreateInviteViewModel = { username: formData.username.value, mail: formData.mail.value, firstname: formData.firstname.value, lastname: formData.lastname.value, }; + this.status = "loading"; this.createInvite(createInvite) .then((result) => { this.status = { status: "success" }; @@ -86,7 +88,7 @@ export default defineComponent({ }) .catch((err) => { this.status = { status: "failed", reason: err.response.data }; - }) + }); }, }, }); diff --git a/src/serverCom.ts b/src/serverCom.ts index 893a376..45afab9 100644 --- a/src/serverCom.ts +++ b/src/serverCom.ts @@ -66,7 +66,11 @@ http.interceptors.response.use( } const notificationStore = useNotificationStore(); - notificationStore.push("Fehler", error.response.data, "error"); + if (error.toString().includes("Network Error")) { + notificationStore.push("Netzwerkfehler", "Server nicht erreichbar!", "error"); + } else { + notificationStore.push("Fehler", error.response.data, "error"); + } return Promise.reject(error); }