diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-05-29 22:40:31 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-06 11:40:09 +0200 |
commit | 127b21b493323034eff6944c0ec7a808529e7529 (patch) | |
tree | bec7b22ec6ea828b1716b39833ca447571bff67c /settings/src/store | |
parent | 5f8b935c8e44304db3d0d0caefbc78e503041bcf (diff) | |
download | nextcloud-server-127b21b493323034eff6944c0ec7a808529e7529.tar.gz nextcloud-server-127b21b493323034eff6944c0ec7a808529e7529.zip |
Implement app bundle management
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/src/store')
-rw-r--r-- | settings/src/store/apps.js | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js index 5d935f59292..09bc00a3966 100644 --- a/settings/src/store/apps.js +++ b/settings/src/store/apps.js @@ -138,28 +138,42 @@ const getters = { const actions = { enableApp(context, { appId, groups }) { + let apps; + if (Array.isArray(appId)) { + apps = appId; + } else { + apps = [appId]; + } return api.requireAdmin().then((response) => { - return api.post(OC.generateUrl(`settings/apps/enable/${appId}`), { - groups: groups - }) + return api.post(OC.generateUrl(`settings/apps/enable`), {appIds: apps, groups: groups}) .then((response) => { - context.commit('enableApp', {appId: appId, groups: groups}); + apps.forEach(_appId => { + context.commit('enableApp', {appId: _appId, groups: groups}); + }); return true; }) .catch((error) => context.commit('APPS_API_FAILURE', { appId, error })) }).catch((error) => context.commit('API_FAILURE', { appId, error })); - }, disableApp(context, { appId }) { + let apps; + if (Array.isArray(appId)) { + apps = appId; + } else { + apps = [appId]; + } return api.requireAdmin().then((response) => { - return api.get(OC.generateUrl(`settings/apps/disable/${appId}`)) + return api.post(OC.generateUrl(`settings/apps/disable`), {appIds: apps}) .then((response) => { - context.commit('disableApp', appId); + apps.forEach(_appId => { + context.commit('disableApp', _appId); + }); return true; }) .catch((error) => context.commit('APPS_API_FAILURE', { appId, error })) }).catch((error) => context.commit('API_FAILURE', { appId, error })); }, + // TODO: use enable app installApp(context, { appId }) { return api.requireAdmin().then((response) => { return api.get(OC.generateUrl(`settings/apps/enable/${appId}`)) |