Skip to content
Snippets Groups Projects
Commit e986fe03 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #4195

Closes #4195

Merge request studip/studip!3026
parent c89b1755
No related branches found
No related tags found
No related merge requests found
...@@ -81,11 +81,10 @@ class Admin_CacheController extends AuthenticatedController ...@@ -81,11 +81,10 @@ class Admin_CacheController extends AuthenticatedController
/** /**
* Fetches necessary configuration for given cache type. * 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); $type = CacheType::findOneByClass_name($className);
$this->render_json($type->class_name::getConfig()); $this->render_json($type->class_name::getConfig());
......
...@@ -82,24 +82,24 @@ export default { ...@@ -82,24 +82,24 @@ export default {
* @param event * @param event
*/ */
getCacheConfig (event) { getCacheConfig (event) {
fetch(STUDIP.URLHelper.getURL(`dispatch.php/admin/cache/get_config/${this.selectedCacheType}`)) const url = STUDIP.URLHelper.getURL(
.then((response) => { 'dispatch.php/admin/cache/get_config',
if (!response.ok) { {cache: this.selectedCacheType},
throw response true
} );
fetch(url).then((response) => {
if (!response.ok) {
throw response
}
response.json() response.json().then((json) => {
.then((json) => { this.configComponent = json.component
this.configComponent = json.component this.configProps = json.props
this.configProps = json.props });
}).catch((error) => { }).catch((error) => {
console.error(error) console.error(error)
console.error(error.status + ': ', error.statusText) console.error(error.status + ': ', error.statusText)
}) })
}).catch((error) => {
console.error(error)
console.error(error.status + ': ', error.statusText)
})
}, },
validateConfig () { validateConfig () {
if (this.configComponent == null || this.isValid) { if (this.configComponent == null || this.isValid) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment