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