mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
move queries
This commit is contained in:
parent
910f165103
commit
8aec6d7406
53 changed files with 920 additions and 485 deletions
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,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue