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.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
return array of event properties per eventId
Francis Cao322c12dd030b
diff --git a/src/app/api/websites/[websiteId]/event-data/route.ts b/src/app/api/websites/[websiteId]/event-data/route.tsindex 5bc36fa4d..193dfda82 100644--- a/src/app/api/websites/[websiteId]/event-data/route.ts+++ b/src/app/api/websites/[websiteId]/event-data/route.ts@@ -29,7 +29,21 @@ export async function GET(const filters = await getQueryFilters(query, websiteId);- const data = await getEventData(websiteId, filters);+ const rows = await getEventData(websiteId, filters);++ const eventMap = new Map<+ string,+ { websiteId: string; eventId: string; eventName: string; eventProperties: object[] }+ >();++ for (const { websiteId, eventId, eventName, ...props } of rows) {+ let entry = eventMap.get(eventId);+ if (!entry) {+ entry = { websiteId, eventId, eventName, eventProperties: [] };+ eventMap.set(eventId, entry);+ }+ entry.eventProperties.push(props);+ }- return json(data);+ return json([...eventMap.values()]);}