Use correct typing for totalTeamMembers (#12152)
parent
0a59c95b93
commit
31f3d9778e
|
@ -130,14 +130,15 @@ async function getInfoForAllTeams({ ctx, input }: GetOptions) {
|
||||||
|
|
||||||
// Get total team count across all teams the user is in (for pagination)
|
// Get total team count across all teams the user is in (for pagination)
|
||||||
|
|
||||||
const totalTeamMembers =
|
const totalTeamMembers = await prisma.$queryRaw<
|
||||||
await prisma.$queryRaw<number>`SELECT COUNT(DISTINCT "userId")::integer from "Membership" WHERE "teamId" IN (${Prisma.join(
|
{
|
||||||
teamIds
|
count: number;
|
||||||
)})`;
|
}[]
|
||||||
|
>`SELECT COUNT(DISTINCT "userId")::integer from "Membership" WHERE "teamId" IN (${Prisma.join(teamIds)})`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
teamMembers,
|
teamMembers,
|
||||||
totalTeamMembers,
|
totalTeamMembers: totalTeamMembers[0].count,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue