Remove sensitive user information.

This commit is contained in:
Brian Cao 2023-03-29 20:54:54 -07:00
parent 6d5aeb3bd1
commit 44e6bff6b1
3 changed files with 32 additions and 9 deletions

View file

@ -19,13 +19,20 @@ export async function getTeamUser(teamId: string, userId: string): Promise<TeamU
});
}
export async function getTeamUsers(teamId: string): Promise<TeamUser[]> {
export async function getTeamUsers(
teamId: string,
): Promise<(TeamUser & { user: { id: string; username: string } })[]> {
return prisma.client.teamUser.findMany({
where: {
teamId,
},
include: {
user: true,
user: {
select: {
id: true,
username: true,
},
},
},
});
}