fix clickhouse calls

This commit is contained in:
Brian Cao 2022-09-23 22:29:54 -07:00
parent dfac7e1af5
commit c6aefd7e6d
10 changed files with 41 additions and 34 deletions

View file

@ -9,7 +9,7 @@ export async function getWebsiteStats(...args) {
});
}
async function relationalQuery(website_id, start_at, end_at, filters = {}) {
async function relationalQuery(website_id, { start_at, end_at, filters = {} }) {
const { getDateQuery, getTimestampInterval, parseFilters, rawQuery } = prisma;
const params = [website_id, start_at, end_at];
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
@ -41,7 +41,7 @@ async function relationalQuery(website_id, start_at, end_at, filters = {}) {
);
}
async function clickhouseQuery(website_id, start_at, end_at, filters = {}) {
async function clickhouseQuery(website_id, { start_at, end_at, filters = {} }) {
const { rawQuery, getDateQuery, getBetweenDates, parseFilters } = clickhouse;
const params = [website_id];
const { pageviewQuery, sessionQuery } = parseFilters(null, filters, params);