Filter users when password reset is required

This commit is contained in:
Angelina Filippova 2019-10-25 00:47:04 +02:00
parent 679c4433d1
commit aa9ea40961
2 changed files with 8 additions and 2 deletions

View file

@ -210,7 +210,11 @@ const users = {
dispatch('SuccessMessage')
},
async RequirePasswordReset({ dispatch, getters }, user) {
try {
await requirePasswordReset(user.nickname, getters.authHost, getters.token)
} catch (_e) {
return
}
dispatch('SuccessMessage')
},
async SearchUsers({ commit, dispatch, state, getters }, { query, page }) {

View file

@ -206,7 +206,9 @@ export default {
applyAction(filtered, removeTagFn)
},
requirePasswordReset: () => {
this.selectedUsers.map(user => this.$store.dispatch('RequirePasswordReset', user))
const filtered = this.selectedUsers.filter(user => user.local)
filtered.map(user => this.$store.dispatch('RequirePasswordReset', user))
this.$emit('apply-action')
}
}
},