mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
21 lines
583 B
JavaScript
21 lines
583 B
JavaScript
import prisma from 'lib/prisma';
|
|
|
|
export async function resetWebsite(websiteId) {
|
|
const { client, transaction } = prisma;
|
|
|
|
return transaction([
|
|
client.pageview.deleteMany({
|
|
where: { session: { website: { websiteUuid: websiteId } } },
|
|
}),
|
|
client.eventData.deleteMany({
|
|
where: { event: { session: { website: { websiteUuid: websiteId } } } },
|
|
}),
|
|
client.event.deleteMany({
|
|
where: { session: { website: { websiteUuid: websiteId } } },
|
|
}),
|
|
client.session.deleteMany({
|
|
where: { website: { websiteUuid: websiteId } },
|
|
}),
|
|
]);
|
|
}
|