Skip to content

Commit

Permalink
fix: correctly query roles to be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Nov 6, 2023
1 parent 78cf9d0 commit 0d16ce4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/db/access-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,10 @@ export class AccessStore implements IAccessStore {
userId: number,
roleTypes: string[],
): Promise<void> {
const rolesToRemove = this.db(T.ROLES)
const rolesToRemove = await this.db(T.ROLES)
.select('id')
.whereIn('type', roleTypes);
.whereIn('type', roleTypes)
.pluck('id');

return this.db(T.ROLE_USER)
.where({ user_id: userId })
Expand Down

0 comments on commit 0d16ce4

Please sign in to comment.