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.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index 1bbded9..adc78f8 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -130,7 +130,7 @@ export default {
}
})
},
- deleteGroups (context, { selected }) {
+ deleteGroups (context, { selected, callback }) {
const ids = selected.map(x => x.id)
axios.post('/api/groups/delete', { ids }).then(() => {
var i = 1
@@ -142,18 +142,20 @@ export default {
i++
}
context.dispatch('reload')
+ if (callback) callback()
})
},
- deleteClients (context, { selected }) {
+ deleteClients (context, { selected, callback }) {
const ids = selected.map(x => x.id)
axios.post('/api/clients/delete', { ids }).then(() => {
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()
})
},
- removeSubroups (context, { tabIndex, selected }) {
+ removeSubroups (context, { tabIndex, selected,callback }) {
const id = context.state.tabChain[tabIndex].id
const ids = selected.map(x => x.id)
axios.post('/api/groups/removeSubgroups', { id, ids }).then(() => {
@@ -163,9 +165,10 @@ export default {
context.commit('deleteFromTabChain', { index: tabIndex + 1, count: context.state.tabChain.length - (tabIndex + 1) })
}
context.dispatch('reload')
+ if (callback) callback()
})
},
- removeClients (context, { tabIndex, selected }) {
+ removeClients (context, { tabIndex, selected, callback }) {
const id = context.state.tabChain[tabIndex].id
const ids = selected.map(x => x.id)
axios.post('/api/groups/removeClients', { id, ids }).then(() => {
@@ -175,20 +178,23 @@ export default {
context.commit('deleteFromTabChain', { index: tabIndex + 1, count: 1 })
}
context.dispatch('reload')
+ if (callback) callback()
})
},
- addSubgroups (context, { tabIndex, selected }) {
+ addSubgroups (context, { tabIndex, selected, callback }) {
const id = context.state.tabChain[tabIndex].id
const ids = selected.map(x => x.id)
axios.post('/api/groups/addSubgroups', { id, ids }).then(() => {
context.dispatch('reload')
+ if (callback) callback()
})
},
- addClients (context, { tabIndex, selected }) {
+ addClients (context, { tabIndex, selected, callback }) {
const id = context.state.tabChain[tabIndex].id
const ids = selected.map(x => x.id)
axios.post('/api/groups/addClients', { id, ids }).then(() => {
context.dispatch('reload')
+ if (callback) callback()
})
}
}