diff --git a/app/controllers/admin/cache.php b/app/controllers/admin/cache.php index 3e9d970a76d739fdc53be9eb410de27e717f3be7..c016af5efd6ed545af3308f313abffc992134001 100644 --- a/app/controllers/admin/cache.php +++ b/app/controllers/admin/cache.php @@ -81,11 +81,10 @@ class Admin_CacheController extends AuthenticatedController /** * Fetches necessary configuration for given cache type. - * - * @param string $className */ - public function get_config_action($className) + public function get_config_action() { + $className = Request::get('cache'); $type = CacheType::findOneByClass_name($className); $this->render_json($type->class_name::getConfig()); diff --git a/resources/vue/components/CacheAdministration.vue b/resources/vue/components/CacheAdministration.vue index af3d461f6955453c947ca0e8f86e95b5feeca6ff..5da9568d415fbbeb042f17a88602b855b27aae62 100644 --- a/resources/vue/components/CacheAdministration.vue +++ b/resources/vue/components/CacheAdministration.vue @@ -82,24 +82,24 @@ export default { * @param event */ getCacheConfig (event) { - fetch(STUDIP.URLHelper.getURL(`dispatch.php/admin/cache/get_config/${this.selectedCacheType}`)) - .then((response) => { - if (!response.ok) { - throw response - } + const url = STUDIP.URLHelper.getURL( + 'dispatch.php/admin/cache/get_config', + {cache: this.selectedCacheType}, + true + ); + fetch(url).then((response) => { + if (!response.ok) { + throw response + } - response.json() - .then((json) => { - this.configComponent = json.component - this.configProps = json.props - }).catch((error) => { - console.error(error) - console.error(error.status + ': ', error.statusText) - }) - }).catch((error) => { - console.error(error) - console.error(error.status + ': ', error.statusText) - }) + response.json().then((json) => { + this.configComponent = json.component + this.configProps = json.props + }); + }).catch((error) => { + console.error(error) + console.error(error.status + ': ', error.statusText) + }) }, validateConfig () { if (this.configComponent == null || this.isValid) {