mirror of
https://github.com/koel/koel
synced 2024-11-28 15:00:42 +00:00
fix: remove invitation after revocation
This commit is contained in:
parent
55e11daf49
commit
39931bf2ae
2 changed files with 10 additions and 3 deletions
|
@ -13,5 +13,8 @@ export const invitationService = {
|
||||||
users.forEach(user => userStore.add(user))
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,7 @@ export const userStore = {
|
||||||
|
|
||||||
async destroy (user: User) {
|
async destroy (user: User) {
|
||||||
await http.delete(`users/${user.id}`)
|
await http.delete(`users/${user.id}`)
|
||||||
this.state.users = differenceBy(this.state.users, [user], 'id')
|
this.remove(user)
|
||||||
this.vault.delete(user.id)
|
|
||||||
|
|
||||||
// Mama, just killed a man
|
// Mama, just killed a man
|
||||||
// Put a gun against his head
|
// Put a gun against his head
|
||||||
|
@ -106,5 +105,10 @@ export const userStore = {
|
||||||
// Mama, oooh
|
// Mama, oooh
|
||||||
// I don't want to die
|
// I don't want to die
|
||||||
// I sometimes wish I'd never been born at all
|
// 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue