diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php index aea7dc0ec..98d9e3224 100755 --- a/application/controllers/Cis/ProfilUpdate.php +++ b/application/controllers/Cis/ProfilUpdate.php @@ -480,9 +480,6 @@ class ProfilUpdate extends Auth_Controller public function getProfilUpdateWithPermission($status = null) { - - - // early return if no status has been passed as argument if (!isset($status)) { echo json_encode($this->ProfilUpdateModel->getProfilUpdateWithPermission()); diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index bf2a9c637..56ad16746 100755 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -59,8 +59,12 @@ const profilApp = Vue.createApp({ //? use function syntax for provide so that we can access `this` provide() { return { - profilUpdateStates: Vue.computed(() => this.profilUpdateStates), - profilUpdateTopic: Vue.computed(() => this.profilUpdateTopic), + profilUpdateStates: Vue.computed(() => + this.profilUpdateStates ? this.profilUpdateStates : null + ), + profilUpdateTopic: Vue.computed(() => + this.profilUpdateTopic ? this.profilUpdateTopic : null + ), setLoading: (newValue) => { this.loading = newValue; }, diff --git a/public/js/apps/Cis/ProfilUpdateRequests.js b/public/js/apps/Cis/ProfilUpdateRequests.js index 10e11a200..f62d096af 100755 --- a/public/js/apps/Cis/ProfilUpdateRequests.js +++ b/public/js/apps/Cis/ProfilUpdateRequests.js @@ -3,22 +3,32 @@ import ProfilUpdateView from "../../components/Cis/ProfilUpdate/ProfilUpdateView import Phrasen from "../../plugin/Phrasen.js"; Vue.$fhcapi = fhcapifactory; - - const app = Vue.createApp({ components: { - ['profil-update-view']:ProfilUpdateView, - + ["profil-update-view"]: ProfilUpdateView, }, - + data() { return { - - } - },methods:{ - - } - + profilUpdateStates: null, + }; + }, + provide() { + return { + profilUpdateStates: Vue.computed(() => + this.profilUpdateStates ? this.profilUpdateStates : false + ), + }; + }, + methods: {}, + created() { + Vue.$fhcapi.ProfilUpdate.getStatus() + .then((response) => { + this.profilUpdateStates = response.data; + }) + .catch((error) => { + console.error(error); + }); + }, }); app.use(Phrasen).mount("#content"); - diff --git a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js index 4f869e573..8650f2b55 100755 --- a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js +++ b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js @@ -135,14 +135,6 @@ export default { -