Use correct typing for totalTeamMembers (#12152)

pull/11564/head^2
sean-brydon 2023-10-30 15:29:09 +00:00 committed by GitHub
parent 0a59c95b93
commit 31f3d9778e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -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,
}; };
} }