Skip to content

Commit

Permalink
fix count of referent
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Dec 11, 2024
1 parent 88993c3 commit 0447c43
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const createPgReferentRepository = (db: Kysely<Database>): SoftwareRefere
getTotalCount: async () => {
const { total_referents } = await db
.selectFrom("software_referents")
.select(qb => qb.fn.countAll<string>().as("total_referents"))
.select(qb => qb.fn.count<string>("agentId").distinct().as("total_referents"))
.executeTakeFirstOrThrow();
return parseInt(total_referents);
}
Expand Down

0 comments on commit 0447c43

Please sign in to comment.