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.

add funnel updates to relational query

Francis Cao6ee9bb07dae3
diff --git a/src/pages/api/reports/funnel.ts b/src/pages/api/reports/funnel.ts
index d2a6ae8cc..35759a303 100644
--- a/src/pages/api/reports/funnel.ts
+++ b/src/pages/api/reports/funnel.ts
@@ -34,7 +34,8 @@ const schema = {
value: yup.string().required(),
}),
)
- .min(2),
+ .min(2)
+ .required(),
window: yup.number().positive().required(),
dateRange: yup
.object()
diff --git a/src/queries/analytics/reports/getFunnel.ts b/src/queries/analytics/reports/getFunnel.ts
index 81333c6b5..a7dfd542a 100644
--- a/src/queries/analytics/reports/getFunnel.ts
+++ b/src/queries/analytics/reports/getFunnel.ts
@@ -82,7 +82,7 @@ async function relationalQuery(
from website_event
where website_id = {{websiteId::uuid}}
and created_at between {{startDate}} and {{endDate}}
- and ${column} ${operator} {param${i}:String}
+ and ${column} ${operator} {{${i}}}
)`;
} else {
pv.levelQuery += `
@@ -96,7 +96,7 @@ async function relationalQuery(
`l.created_at `,
`${windowMinutes} minute`,
)}
- and we.${column} ${operator} {param${i}:String}
+ and we.${column} ${operator} {{${i}}}
and we.created_at <= {{endDate}}
)`;
}