From 328a46f16dfdee143017b241eea8e7d38db57982 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Thu, 18 Jul 2024 10:40:30 +0200 Subject: [PATCH] adds getTopic to the new ProfilUpdate FhcAPIController --- .../controllers/api/frontend/v1/ProfilUpdate.php | 10 +++++++++- public/js/api/profilUpdate.js | 2 +- public/js/apps/Cis/Profil.js | 3 +-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php index 2890b1f59..df594d3cf 100644 --- a/application/controllers/api/frontend/v1/ProfilUpdate.php +++ b/application/controllers/api/frontend/v1/ProfilUpdate.php @@ -39,7 +39,7 @@ class ProfilUpdate extends FHCAPI_Controller { parent::__construct([ 'getStatus' => self::PERM_LOGGED, - 'fotoSperre' => self::PERM_LOGGED, + 'getTopic' => self::PERM_LOGGED, ]); @@ -94,6 +94,14 @@ class ProfilUpdate extends FHCAPI_Controller } + public function getTopic() + { + if(!count(self::$TOPICS)){ + $this->terminateWithError('No topics found'); + } + $this->terminateWithSuccess(self::$TOPICS); + } + } \ No newline at end of file diff --git a/public/js/api/profilUpdate.js b/public/js/api/profilUpdate.js index 08b9ad4b7..5d4978ce4 100644 --- a/public/js/api/profilUpdate.js +++ b/public/js/api/profilUpdate.js @@ -12,7 +12,7 @@ export default { return this.$fhcApi.get( FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + - `/Cis/ProfilUpdate/getTopic`,{}); + `/api/frontend/v1/ProfilUpdate/getTopic`,{}); }, getProfilUpdateRequest: function () { diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 728bcd09f..1fa2e404b 100755 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -358,14 +358,13 @@ const profilApp = Vue.createApp({ await this.$fhcApi.factory.profilUpdate.getStatus() .then((response) => { - console.log(response.data,"this is the response when we set the status") this.profilUpdateStates = response.data; }) .catch((error) => { console.error(error); }); - Vue.$fhcapi.ProfilUpdate.getTopic() + this.$fhcApi.factory.profilUpdate.getTopic() .then((response) => { this.profilUpdateTopic = response.data; })