1
0
mirror of https://github.com/flarum/core.git synced 2025-10-14 00:15:51 +02:00

Allow custom variables to be set on the client app

This commit is contained in:
Toby Zerner
2015-07-31 20:08:27 +09:30
parent 513d896f51
commit e204794b91
7 changed files with 92 additions and 39 deletions

View File

@@ -0,0 +1,14 @@
export default function saveConfig(config) {
const oldConfig = JSON.parse(JSON.stringify(app.config));
Object.assign(app.config, config);
return app.request({
method: 'POST',
url: app.forum.attribute('adminUrl') + '/config',
data: {config}
}).catch(error => {
app.config = oldConfig;
throw error;
});
}