umami/queries/analytics/event/getEvents.js
2022-07-15 16:47:38 -07:00

19 lines
335 B
JavaScript

import { prisma, runQuery } from 'lib/db';
export async function getEvents(websites, start_at) {
return runQuery(
prisma.event.findMany({
where: {
website: {
website_id: {
in: websites,
},
},
created_at: {
gte: start_at,
},
},
}),
);
}