aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-21 08:38:10 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-05-21 08:38:10 +0000
commite986fe03b58ae15f0ba307ed6c673f3eda402f00 (patch)
tree6166864e0f5a702d863085dd48bff8d494b09844
parentc89b17558da887a4e1c4164307b54b0576c23376 (diff)
fixes #4195
Closes #4195 Merge request studip/studip!3026
-rw-r--r--app/controllers/admin/cache.php5
-rw-r--r--resources/vue/components/CacheAdministration.vue34
2 files changed, 19 insertions, 20 deletions
diff --git a/app/controllers/admin/cache.php b/app/controllers/admin/cache.php
index 3e9d970..c016af5 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 af3d461..5da9568 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) {