Fix optimistc update for deleting users
This commit is contained in:
parent
434f8ad2dd
commit
d211d4f934
1 changed files with 4 additions and 3 deletions
|
@ -193,9 +193,10 @@ const users = {
|
|||
} catch (_e) {
|
||||
return
|
||||
}
|
||||
const deletedUsersIds = users.map(deletedUser => deletedUser.id)
|
||||
const updatedUsers = state.fetchedUsers.filter(user => !deletedUsersIds.includes(user.id))
|
||||
commit('SET_USERS', updatedUsers)
|
||||
const updatedUsers = users.map(user => {
|
||||
return { ...user, deactivated: true }
|
||||
})
|
||||
commit('SWAP_USERS', updatedUsers)
|
||||
|
||||
if (_userId) {
|
||||
dispatch('FetchUserProfile', { userId: _userId, godmode: false })
|
||||
|
|
Loading…
Reference in a new issue