mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
20 lines
449 B
JavaScript
20 lines
449 B
JavaScript
import prisma from 'lib/prisma';
|
|
|
|
export async function resetWebsite(id) {
|
|
const { client, transaction } = prisma;
|
|
|
|
return transaction([
|
|
client.pageview.deleteMany({
|
|
where: { websiteId: id },
|
|
}),
|
|
client.eventData.deleteMany({
|
|
where: { event: { websiteId: id } },
|
|
}),
|
|
client.event.deleteMany({
|
|
where: { websiteId: id },
|
|
}),
|
|
client.session.deleteMany({
|
|
where: { websiteId: id },
|
|
}),
|
|
]);
|
|
}
|