From 1208c6829ce429d13b0fbbda7ea46d8445715a44 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Thu, 12 Sep 2024 11:53:13 +0200 Subject: [PATCH] when an error happenes to editProfil Modal will also be closed then --- application/controllers/api/frontend/v1/ProfilUpdate.php | 2 +- public/js/components/Cis/Profil/ProfilModal/EditProfil.js | 8 ++++++++ .../components/Cis/Profil/ProfilModal/EditProfilSelect.js | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php index 328ed3d61..c55c9b4f9 100644 --- a/application/controllers/api/frontend/v1/ProfilUpdate.php +++ b/application/controllers/api/frontend/v1/ProfilUpdate.php @@ -160,7 +160,7 @@ class ProfilUpdate extends FHCAPI_Controller $res = $this->getDataOrTerminateWithError($res); //? the user cannot delete a zustelladresse/kontakt - if (isset($payload["delete"]) && $payload-[$identifier == "kontakt_id" ? "zustellung" : "zustelladresse"]) { + if (isset($payload["delete"]) && $payload[$identifier == "kontakt_id" ? "zustellung" : "zustelladresse"]) { $this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error')); } diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js index 45a41d8ab..f6be99fd2 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js @@ -104,6 +104,10 @@ export default { }) .catch((err) => { console.error(err); + this.loading = false; + this.setLoading(false); + this.result = false; + this.hide(); }) : this.$fhcApi.factory.profilUpdate.insertProfilRequest( this.topic, @@ -115,6 +119,10 @@ export default { }) .catch((err) => { console.error(err); + this.loading = false; + this.setLoading(false); + this.result = false; + this.hide(); }); } }, diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilSelect.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilSelect.js index b9b45a1a7..81b294b57 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfilSelect.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilSelect.js @@ -94,10 +94,10 @@ export default { item.data.delete = true; this.$emit("update:profilUpdate", item.data); //? updates the topic when a Kontakt or an Address should be deleted - this.topic = this.profilUpdateTopic["Private Adressen"] + this.modal_topic = this.profilUpdateTopic["Private Adressen"] ? this.profilUpdateTopic["Delete Adresse"] : this.profilUpdateTopic["Delete Kontakt"]; - this.$emit("update:topic", this.topic); + this.$emit("update:topic", this.modal_topic); this.$emit("submit"); },