Commit d211d4f9 authored by Angelina Filippova's avatar Angelina Filippova

Fix optimistc update for deleting users

parent 434f8ad2
......@@ -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 })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment