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
/**
* 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());
......
......@@ -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) {
......
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