diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-05-30 16:06:18 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-06-06 11:40:09 +0200 |
commit | 1a034ce6993373b35ac05fb7a7463fc5b55b69ae (patch) | |
tree | 550ea3696ecb236642cd28a831110d532d990dc2 /settings | |
parent | 5128f7ea30abea98d38033b79d57e980024deb17 (diff) | |
download | nextcloud-server-1a034ce6993373b35ac05fb7a7463fc5b55b69ae.tar.gz nextcloud-server-1a034ce6993373b35ac05fb7a7463fc5b55b69ae.zip |
Implement update functionality
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/src/store/apps.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js index f19f894309b..9fedabf0223 100644 --- a/settings/src/store/apps.js +++ b/settings/src/store/apps.js @@ -99,6 +99,15 @@ const mutations = { state.apps.find(app => app.id === appId).canInstall = true; }, + updateApp(state, appId) { + let app = state.apps.find(app => app.id === appId); + let version = app.update; + app.update = null; + app.version = version; + state.updateCount--; + + }, + resetApps(state) { state.apps = []; }, @@ -246,6 +255,22 @@ const actions = { }).catch((error) => context.commit('API_FAILURE', { appId, error })); }, + updateApp(context, { appId }) { + return api.requireAdmin().then((response) => { + context.commit('startLoading', appId); + return api.get(OC.generateUrl(`settings/apps/update/${appId}`)) + .then((response) => { + context.commit('stopLoading', appId); + context.commit('updateApp', appId); + return true; + }) + .catch((error) => { + context.commit('stopLoading', appId); + context.commit('APPS_API_FAILURE', { appId, error }) + }) + }).catch((error) => context.commit('API_FAILURE', { appId, error })); + }, + getApps(context, { category }) { context.commit('startLoading', 'list'); return api.get(OC.generateUrl(`settings/apps/list?category=${category}`)) |