fix order by and revert getDateSQL

This commit is contained in:
Francis Cao 2024-08-23 16:43:38 -07:00
parent 8500669ed0
commit 004ccdc22f
4 changed files with 13 additions and 4 deletions

View file

@ -31,6 +31,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
and event_type = {{eventType}}
${filterQuery}
group by 1
order by 1
`,
params,
);

View file

@ -24,6 +24,7 @@ async function relationalQuery(
createdAt: { gte: startDate, lte: endDate },
},
take: 500,
orderBy: { createdAt: 'desc' },
});
}

View file

@ -31,6 +31,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
and event_type = {{eventType}}
${filterQuery}
group by 1
order by 1
`,
params,
);