summaryrefslogtreecommitdiffstats
path: root/settings/src/store
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-07-04 13:36:16 +0200
committerJulius Härtl <jus@bitgrid.net>2018-07-04 15:40:51 +0200
commitebeb2da3d3e474c60f765020ede3cf23cfb03be0 (patch)
tree168a8027b540390e9548381f9141ec61bcf8d1e8 /settings/src/store
parent96e65c677be77315cd6b6f5a3a0819b04803ebf6 (diff)
downloadnextcloud-server-ebeb2da3d3e474c60f765020ede3cf23cfb03be0.tar.gz
nextcloud-server-ebeb2da3d3e474c60f765020ede3cf23cfb03be0.zip
Fix displaying errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/src/store')
-rw-r--r--settings/src/store/apps.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/settings/src/store/apps.js b/settings/src/store/apps.js
index c4539b14d93..99bd4af4595 100644
--- a/settings/src/store/apps.js
+++ b/settings/src/store/apps.js
@@ -62,8 +62,13 @@ const mutations = {
},
setError(state, {appId, error}) {
- let app = state.apps.find(app => app.id === appId);
- app.error = error;
+ if (!Array.isArray(appId)) {
+ appId = [appId];
+ }
+ appId.forEach((_id) => {
+ let app = state.apps.find(app => app.id === _id);
+ app.error = error;
+ });
},
clearError(state, {appId, error}) {
@@ -199,10 +204,13 @@ const actions = {
});
})
.catch((error) => {
- context.commit('setError', {appId: apps, error: t('settings', 'Error while enabling app')});
context.commit('stopLoading', apps);
context.commit('stopLoading', 'install');
- context.commit('APPS_API_FAILURE', { appId, error })
+ context.commit('setError', {
+ appId: apps,
+ error: error.response.data.data.message
+ });
+ context.commit('APPS_API_FAILURE', { appId, error});
})
}).catch((error) => context.commit('API_FAILURE', { appId, error }));
},