Hook up teamMemberDelete and teamDelete.

This commit is contained in:
Brian Cao 2023-03-09 23:21:19 -08:00
parent c3426a67ee
commit 701bde53b7
7 changed files with 150 additions and 21 deletions

View file

@ -52,17 +52,17 @@ export async function updateTeam(
export async function deleteTeam(
teamId: string,
): Promise<Promise<[Prisma.BatchPayload, Prisma.BatchPayload, Team]>> {
const { client } = prisma;
const { client, transaction } = prisma;
return prisma.transaction([
return transaction([
client.teamWebsite.deleteMany({
where: {
id: teamId,
teamId,
},
}),
client.teamUser.deleteMany({
where: {
id: teamId,
teamId,
},
}),
client.team.delete({