mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
commit
17e2658fdc
@ -15,13 +15,22 @@ export function getWebsiteEvents(
|
|||||||
async function relationalQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
async function relationalQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
||||||
const { pagedQuery } = prisma;
|
const { pagedQuery } = prisma;
|
||||||
const { query } = pageParams;
|
const { query } = pageParams;
|
||||||
|
const { startDate, endDate } = filters;
|
||||||
|
|
||||||
const where = {
|
const where = {
|
||||||
id: websiteId,
|
websiteId,
|
||||||
|
createdAt: {
|
||||||
|
lte: endDate,
|
||||||
|
gte: startDate,
|
||||||
|
},
|
||||||
...prisma.getSearchParameters(query, [{ eventName: 'contains' }, { urlPath: 'contains' }]),
|
...prisma.getSearchParameters(query, [{ eventName: 'contains' }, { urlPath: 'contains' }]),
|
||||||
};
|
};
|
||||||
|
|
||||||
return pagedQuery('WebsiteEvent', { where }, pageParams);
|
return pagedQuery(
|
||||||
|
'websiteEvent',
|
||||||
|
{ where },
|
||||||
|
{ orderBy: 'createdAt', sortDescending: true, ...pageParams },
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function clickhouseQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
async function clickhouseQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user