mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-06 01:15:42 +01:00
fix websiteEvent query
This commit is contained in:
parent
8ee4fc32fd
commit
adc65e4487
@ -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…
Reference in New Issue
Block a user