Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed query.

Mike Cao7ec84ae7ea3c
diff --git a/lib/prisma.ts b/lib/prisma.ts
index d2749ed72..b02f69f7b 100644
--- a/lib/prisma.ts
+++ b/lib/prisma.ts
@@ -151,7 +151,7 @@ async function rawQuery(sql: string, data: object): Promise<any> {
return Promise.reject(new Error('Unknown database.'));
}
- const query = sql?.replaceAll(/\{\{(\w+)(::\w+)?}}/g, (...args) => {
+ const query = sql?.replaceAll(/\{\{\s*(\w+)(::\w+)?\s*}}/g, (...args) => {
const [, name, type] = args;
params.push(data[name]);
diff --git a/queries/analytics/pageviews/getPageviewStats.ts b/queries/analytics/pageviews/getPageviewStats.ts
index cd1125cea..8b6438c49 100644
--- a/queries/analytics/pageviews/getPageviewStats.ts
+++ b/queries/analytics/pageviews/getPageviewStats.ts
@@ -60,7 +60,7 @@ async function relationalQuery(
where website_event.website_id = {{websiteId::uuid}}
and website_event.created_at >= {{resetDate}}
and website_event.created_at between {{startDate}} and {{endDate}}
- and event_type = {eventType:UInt32}
+ and event_type = {{eventType}}
${filterQuery}
group by 1
`,