diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-05-23 00:32:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-23 00:32:46 +0200 |
commit | a2c518ee5a3d452973052a627e15bcb3bb812dd3 (patch) | |
tree | 51732ffcac6d5c445dfd0f3773d27fbfdb36d522 /settings/src/store/oc.js | |
parent | b40bae816a5515b6420c0d82bf64eb187b2cd894 (diff) | |
parent | 760b01e8dbad054919fe766112b52d0b9cfb2d32 (diff) | |
download | nextcloud-server-a2c518ee5a3d452973052a627e15bcb3bb812dd3.tar.gz nextcloud-server-a2c518ee5a3d452973052a627e15bcb3bb812dd3.zip |
Merge pull request #8824 from nextcloud/settings-vue
Vue migration: settings
Diffstat (limited to 'settings/src/store/oc.js')
-rw-r--r-- | settings/src/store/oc.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/settings/src/store/oc.js b/settings/src/store/oc.js new file mode 100644 index 00000000000..4bb82075e8a --- /dev/null +++ b/settings/src/store/oc.js @@ -0,0 +1,25 @@ +import api from './api'; + +const state = {}; +const mutations = {}; +const getters = {}; +const actions = { + /** + * Set application config in database + * + * @param {Object} context + * @param {Object} options + * @param {string} options.app Application name + * @param {boolean} options.key Config key + * @param {boolean} options.value Value to set + * @returns{Promise} + */ + setAppConfig(context, {app, key, value}) { + return api.requireAdmin().then((response) => { + return api.post(OC.linkToOCS(`apps/provisioning_api/api/v1/config/apps/${app}/${key}`, 2), {value: value}) + .catch((error) => {throw error;}); + }).catch((error) => context.commit('API_FAILURE', { app, key, value, error }));; + } +}; + +export default {state, mutations, getters, actions}; |