Hook up teamMemberDelete and teamDelete.

This commit is contained in:
Brian Cao committed 2023-03-09 23:21:19 -08:00
1 parent c3426a67ee
commit 701bde53b7
7 files changed
+150 -21

No files matched your search

+4 -4
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({