Delete event_data on website reset/delete.

This commit is contained in:
Brian Cao 2023-04-07 11:40:28 -07:00
parent 594660f298
commit 6b0d6c0d1c
2 changed files with 6 additions and 0 deletions

View File

@ -161,6 +161,9 @@ export async function deleteUser(
return prisma
.transaction([
client.eventData.deleteMany({
where: { websiteId: { in: websiteIds } },
}),
client.websiteEvent.deleteMany({
where: { websiteId: { in: websiteIds } },
}),

View File

@ -78,6 +78,9 @@ export async function deleteWebsite(
const cloudMode = process.env.CLOUD_MODE;
return transaction([
client.eventData.deleteMany({
where: { websiteId },
}),
client.websiteEvent.deleteMany({
where: { websiteId },
}),