fix: remove invitation after revocation

This commit is contained in:
Phan An 2023-08-23 23:46:44 +02:00
parent 55e11daf49
commit 39931bf2ae
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
2 changed files with 10 additions and 3 deletions

View file

@ -13,5 +13,8 @@ export const invitationService = {
users.forEach(user => userStore.add(user))
},
revoke: async (user: User) => await http.delete(`invitations`, { email: user.email })
revoke: async (user: User) => {
await http.delete(`invitations`, { email: user.email })
userStore.remove(user)
}
}

View file

@ -85,8 +85,7 @@ export const userStore = {
async destroy (user: User) {
await http.delete(`users/${user.id}`)
this.state.users = differenceBy(this.state.users, [user], 'id')
this.vault.delete(user.id)
this.remove(user)
// Mama, just killed a man
// Put a gun against his head
@ -106,5 +105,10 @@ export const userStore = {
// Mama, oooh
// I don't want to die
// I sometimes wish I'd never been born at all
},
remove (user: User) {
this.state.users = differenceBy(this.state.users, [user], 'id')
this.vault.delete(user.id)
}
}