Update usage of tag/untag api functions for multiple users
This commit is contained in:
parent
d3d380a9af
commit
d821debd85
1 changed files with 14 additions and 10 deletions
|
@ -130,16 +130,20 @@ export default {
|
||||||
remove: () => this.selectedUsers
|
remove: () => this.selectedUsers
|
||||||
.filter(user => this.$store.state.user.id !== user.id)
|
.filter(user => this.$store.state.user.id !== user.id)
|
||||||
.map(user => this.$store.dispatch('DeleteUser', user)),
|
.map(user => this.$store.dispatch('DeleteUser', user)),
|
||||||
addTag: (tag) => () => this.selectedUsers
|
addTag: (tag) => () => {
|
||||||
|
const users = this.selectedUsers
|
||||||
.filter(user => tag === 'disable_remote_subscription' || tag === 'disable_any_subscription'
|
.filter(user => tag === 'disable_remote_subscription' || tag === 'disable_any_subscription'
|
||||||
? user.local && !user.tags.includes(tag)
|
? user.local && !user.tags.includes(tag)
|
||||||
: !user.tags.includes(tag)
|
: !user.tags.includes(tag))
|
||||||
).map(user => this.$store.dispatch('ToggleTag', { user, tag })),
|
this.$store.dispatch('AddTag', { users, tag })
|
||||||
removeTag: (tag) => () => this.selectedUsers
|
},
|
||||||
|
removeTag: (tag) => () => {
|
||||||
|
const users = this.selectedUsers
|
||||||
.filter(user => tag === 'disable_remote_subscription' || tag === 'disable_any_subscription'
|
.filter(user => tag === 'disable_remote_subscription' || tag === 'disable_any_subscription'
|
||||||
? user.local && user.tags.includes(tag)
|
? user.local && user.tags.includes(tag)
|
||||||
: user.tags.includes(tag)
|
: user.tags.includes(tag))
|
||||||
).map(user => this.$store.dispatch('ToggleTag', { user, tag }))
|
this.$store.dispatch('RemoveTag', { users, tag })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
grantRightToMultipleUsers(right) {
|
grantRightToMultipleUsers(right) {
|
||||||
|
|
Loading…
Reference in a new issue