move queries
This commit is contained in:
19
queries/analytics/event/getEvents.js
Normal file
19
queries/analytics/event/getEvents.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { runQuery } from 'queries';
|
||||
import prisma 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,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user