Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
fix(manager): limit the count to existing users
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Dec 6, 2022
1 parent b5914e7 commit 27e7487
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions database/managers/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ export default class extends BaseManager<
AttachedRole.sequelize.getQueryInterface().queryGenerator.selectQuery(
AttachedRole.tableName, {
"attributes": [ AttachedRole.sequelize.fn("count", "*") ],
"where": new Condition().equal(
"roleID",
AttachedRole.sequelize.col(`${Model.tableName}.id`)
"where": new Condition().and(
new Condition().equal(
"roleID",
AttachedRole.sequelize.col(`${Model.tableName}.id`)
),
new Condition().is("deletedAt", null)
)
.build()
}
Expand Down

0 comments on commit 27e7487

Please sign in to comment.