forked from AkkomaGang/admin-fe
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) {
|
} catch (_e) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const deletedUsersIds = users.map(deletedUser => deletedUser.id)
|
const updatedUsers = users.map(user => {
|
||||||
const updatedUsers = state.fetchedUsers.filter(user => !deletedUsersIds.includes(user.id))
|
return { ...user, deactivated: true }
|
||||||
commit('SET_USERS', updatedUsers)
|
})
|
||||||
|
commit('SWAP_USERS', updatedUsers)
|
||||||
|
|
||||||
if (_userId) {
|
if (_userId) {
|
||||||
dispatch('FetchUserProfile', { userId: _userId, godmode: false })
|
dispatch('FetchUserProfile', { userId: _userId, godmode: false })
|
||||||
|
|
Loading…
Reference in a new issue