Fix user deletion for multiple users

This commit is contained in:
Angelina Filippova 2019-10-16 21:00:25 +02:00
parent 4d58527201
commit d47b3287bd

View file

@ -150,9 +150,9 @@ export default {
},
methods: {
mappers() {
const applyAction = (users, dispatchAction) => {
const applyAction = async(users, dispatchAction) => {
try {
dispatchAction(users)
await dispatchAction(users)
} catch (err) {
console.log(err)
return
@ -192,7 +192,7 @@ export default {
},
remove: () => {
const filtered = this.selectedUsers.filter(user => this.$store.state.user.id !== user.id)
const deleteAccountFn = async(user) => await this.$store.dispatch('DeleteUser', user)
const deleteAccountFn = async(users) => await this.$store.dispatch('DeleteUsers', users)
applyAction(filtered, deleteAccountFn)
},