Updated roles and permissions logic.
This commit is contained in:
@@ -3,7 +3,7 @@ import clickhouse from 'lib/clickhouse';
|
||||
import { runQuery, CLICKHOUSE, PRISMA } from 'lib/db';
|
||||
import cache from 'lib/cache';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { EventType } from 'lib/types';
|
||||
import { EVENT_TYPE } from 'lib/constants';
|
||||
|
||||
export async function getPageviewMetrics(
|
||||
...args: [
|
||||
@@ -43,7 +43,7 @@ async function relationalQuery(
|
||||
${joinSession}
|
||||
where website_id='${websiteId}'
|
||||
and website_event.created_at between $1 and $2
|
||||
and event_type = ${EventType.Pageview}
|
||||
and event_type = ${EVENT_TYPE.pageView}
|
||||
${filterQuery}
|
||||
group by 1
|
||||
order by 2 desc`,
|
||||
@@ -71,9 +71,9 @@ async function clickhouseQuery(
|
||||
from event
|
||||
where website_id = $1
|
||||
and rev_id = $2
|
||||
and event_type = ${EventType.Pageview}
|
||||
and event_type = ${EVENT_TYPE.pageView}
|
||||
${column !== 'event_name' ? `and event_name = ''` : `and event_name != ''`}
|
||||
and ${getBetweenDates('created_at', startDate, endDate)}
|
||||
and ${getBetweenDates('created_at', startDate, endDate)}n
|
||||
${filterQuery}
|
||||
group by x
|
||||
order by y desc`,
|
||||
|
||||
Reference in New Issue
Block a user