Fix missing function argument of getFilterQuery

In getEventMetrics no `column` argument is passed to getFilterQuery.
Thus, the subsequent arguments are shifted by one. This leads to wrong
API responses, since the filters are not properly applied.

One option is to pass a null value as the `column` argument. However, it
is not used in getFilterQuery. Therefore, I removed it.
This commit is contained in:
Robin Bisping 2022-10-22 19:00:57 +02:00
parent 0cb14f3f6c
commit ce572f09f2
7 changed files with 14 additions and 35 deletions

View file

@ -12,12 +12,7 @@ export async function getSessionMetrics(...args) {
async function relationalQuery(website_id, start_at, end_at, field, filters = {}) {
const { parseFilters, rawQuery } = prisma;
const params = [website_id, start_at, end_at];
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
'pageview',
null,
filters,
params,
);
const { pageviewQuery, sessionQuery, joinSession } = parseFilters('pageview', filters, params);
return rawQuery(
`select ${field} x, count(*) y
@ -42,7 +37,6 @@ async function clickhouseQuery(website_id, start_at, end_at, field, filters = {}
const params = [website_id];
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
'pageview',
null,
filters,
params,
'session_uuid',