api and lib fixes

This commit is contained in:
Brian Cao 2022-11-08 11:50:37 -08:00
parent 168283bf11
commit c72e1d69c9
9 changed files with 30 additions and 29 deletions

View file

@ -6,16 +6,16 @@ export async function deleteWebsite(id) {
return transaction([
client.pageview.deleteMany({
where: { session: { website: { id } } },
where: { websiteId: id },
}),
client.eventData.deleteMany({
where: { event: { session: { website: { id } } } },
where: { event: { websiteId: id } },
}),
client.event.deleteMany({
where: { session: { website: { id } } },
where: { websiteId: id },
}),
client.session.deleteMany({
where: { website: { id } },
where: { websiteId: id },
}),
client.website.delete({
where: { id },