summaryrefslogtreecommitdiffstats
path: root/webapp/src/store/groups.js
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/src/store/groups.js')
-rw-r--r--webapp/src/store/groups.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index bd44bb7..8ec6e7c 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -199,15 +199,20 @@ export default {
if (callback) callback()
})
},
- deleteClients (context, { selected, callback, backends }) {
+ deleteClients (context, { selected, callback, snackbar, backends }) {
const ids = selected.map(x => x.id)
const backendIds = backends.filter(x => x.selected).map(x => x.id)
- axios.post('/api/clients/?delete', { ids, backendIds }).then(() => {
+ axios.post('/api/clients/?delete', { ids, backendIds }).then(response => {
const index = context.state.tabChain.length - 1
const item = context.state.tabChain[index]
if (item.tabType === 'client' && ids.includes(item.id)) context.commit('deleteFromTabChain', { index, count: 1 })
context.dispatch('reload')
- if (callback) callback()
+
+ if (callback) {
+ if (response.data.errors) {
+ snackbar('warning', response.data.message)
+ } else callback()
+ }
})
},
removeSubroups (context, { tabIndex, selected, callback }) {