From 88c38c9228c495a7e012ad9b5a50a58a13925ce5 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Fri, 13 Sep 2024 12:37:13 +0200 Subject: [PATCH] fixes ProfilUpdate bugs --- .../Cis/ProfilUpdate/AcceptDenyUpdate.js | 8 +++----- .../Cis/ProfilUpdate/ProfilUpdateView.js | 16 ++++------------ public/js/components/DashboardWidget/Ampel.js | 14 ++------------ 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js index 01232b4d6..300cfe51c 100755 --- a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js +++ b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js @@ -68,14 +68,12 @@ export default { : "denyProfilRequest" ](this.data) .then((res) => { - this.setLoading(false); - this.loading = false; this.result = true; }) - .catch((e) => { - Alert.popup(Vue.h("div", { innerHTML: e.response.data })); - }) + .catch((e) => this.$fhcAlert.handleSystemError) .finally(() => { + this.setLoading(false); + this.loading = false; this.hide(); }); }, diff --git a/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js b/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js index 03bbb1071..4f5f6578f 100644 --- a/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js +++ b/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js @@ -135,9 +135,7 @@ export default { .then((res) => { this.$refs.UpdatesTable.tabulator.setData(); }) - .catch((e) => { - Alert.popup(Vue.h("div", { innerHTML: e.response.data })); - }); + .catch((e) => this.$fhcAlert.handleSystemError); }, }, { @@ -153,9 +151,7 @@ export default { .then((res) => { this.$refs.UpdatesTable.tabulator.setData(); }) - .catch((e) => { - Alert.popup(Vue.h("div", { innerHTML: e.response.data })); - }); + .catch((e) => this.$fhcAlert.handleSystemError); }, }, { @@ -308,9 +304,7 @@ export default { .then((res) => { // block when the request was successful }) - .catch((e) => { - Alert.popup(Vue.h("div", { innerHTML: e.response.data })); - }) + .catch((e) => this.$fhcAlert.handleSystemError) .finally(() => { this.$refs.UpdatesTable.tabulator.setData(); }); @@ -320,9 +314,7 @@ export default { .then((res) => { // block when the request was successful }) - .catch((e) => { - Alert.popup(Vue.h("div", { innerHTML: e.response.data })); - }) + .catch((e) => this.$fhcAlert.handleSystemError) .finally(() => { // update the data inside the table this.$refs.UpdatesTable.tabulator.setData(); diff --git a/public/js/components/DashboardWidget/Ampel.js b/public/js/components/DashboardWidget/Ampel.js index be5db43ea..d7cc60850 100755 --- a/public/js/components/DashboardWidget/Ampel.js +++ b/public/js/components/DashboardWidget/Ampel.js @@ -81,12 +81,7 @@ export default { .then(res => { this.activeAmpeln = res.data; }) - .catch(error => { - if (error.code === 'ECONNABORTED') - this.fetchNonConfirmedActiveAmpeln(); - else - this.$fhcAlert.handleSystemError(error); - }); + .catch(error => this.$fhcAlert.handleSystemError); }, fetchAllActiveAmpeln() { this.$fhcApi.factory @@ -94,12 +89,7 @@ export default { .then(res => { this.allAmpeln = res.data; }) - .catch(error => { - if (error.code === 'ECONNABORTED') - this.fetchAllActiveAmpeln(); - else - this.$fhcAlert.handleSystemError(error); - }); + .catch(error => this.$fhcAlert.handleSystemError); }, async confirm(ampelId) {