Clean up teams on user delete.

This commit is contained in:
Brian Cao 2023-03-02 22:48:30 -08:00
parent 82f0bc3d2b
commit 8684781624
8 changed files with 90 additions and 14 deletions

View file

@ -54,3 +54,15 @@ export async function deleteTeamUser(teamUserId: string): Promise<TeamUser> {
},
});
}
export async function deleteTeamUserByUserId(
userId: string,
teamId: string,
): Promise<Prisma.BatchPayload> {
return prisma.client.teamUser.deleteMany({
where: {
userId,
teamId,
},
});
}