rename propertyName parameter
This commit is contained in:
@@ -10,7 +10,7 @@ export async function getSessionDataProperties(
|
||||
websiteId: string,
|
||||
filters: QueryFilters,
|
||||
propertyFilters?: PropertyFilter[],
|
||||
selectedPropertyName?: string,
|
||||
propertyName?: string,
|
||||
]
|
||||
) {
|
||||
return runQuery({
|
||||
@@ -23,7 +23,7 @@ async function relationalQuery(
|
||||
websiteId: string,
|
||||
filters: QueryFilters,
|
||||
propertyFilters: PropertyFilter[] = [],
|
||||
selectedPropertyName?: string,
|
||||
propertyName?: string,
|
||||
) {
|
||||
const { timezone = 'utc' } = filters;
|
||||
const { rawQuery, parseFilters, getPropertyFilterQuery } = prisma;
|
||||
@@ -56,7 +56,7 @@ async function relationalQuery(
|
||||
join filtered_sessions
|
||||
on filtered_sessions.session_id = session_data.session_id
|
||||
and filtered_sessions.website_id = session_data.website_id
|
||||
${selectedPropertyName ? 'where session_data.data_key = {{selectedPropertyName}}' : ''}
|
||||
${propertyName ? 'where session_data.data_key = {{propertyName}}' : ''}
|
||||
)
|
||||
select
|
||||
data_key as "propertyName",
|
||||
@@ -70,7 +70,7 @@ async function relationalQuery(
|
||||
order by 3 desc, 1 asc
|
||||
limit 500
|
||||
`,
|
||||
{ ...queryParams, websiteId, selectedPropertyName, ...pfParams },
|
||||
{ ...queryParams, websiteId, propertyName, ...pfParams },
|
||||
FUNCTION_NAME,
|
||||
);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ async function clickhouseQuery(
|
||||
websiteId: string,
|
||||
filters: QueryFilters,
|
||||
propertyFilters: PropertyFilter[] = [],
|
||||
selectedPropertyName?: string,
|
||||
propertyName?: string,
|
||||
): Promise<{ propertyName: string; dataType: number; total: number }[]> {
|
||||
const { timezone = 'UTC' } = filters;
|
||||
const { rawQuery, parseFilters, getPropertyFilterQuery } = clickhouse;
|
||||
@@ -107,7 +107,7 @@ async function clickhouseQuery(
|
||||
join filtered_sessions
|
||||
on filtered_sessions.session_id = session_data.session_id
|
||||
and filtered_sessions.website_id = session_data.website_id
|
||||
${selectedPropertyName ? 'where session_data.data_key = {selectedPropertyName:String}' : ''}
|
||||
${propertyName ? 'where session_data.data_key = {propertyName:String}' : ''}
|
||||
)
|
||||
select
|
||||
data_key as propertyName,
|
||||
@@ -123,7 +123,7 @@ async function clickhouseQuery(
|
||||
order by 3 desc, 1 asc
|
||||
limit 500
|
||||
`,
|
||||
{ ...queryParams, websiteId, selectedPropertyName, ...pfParams },
|
||||
{ ...queryParams, websiteId, propertyName, ...pfParams },
|
||||
FUNCTION_NAME,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user