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.

convert count to number

Francis Caoe3df177edcdc
diff --git a/src/queries/analytics/events/getEventUsage.ts b/src/queries/analytics/events/getEventUsage.ts
index e8ed975f6..8baefe06c 100644
--- a/src/queries/analytics/events/getEventUsage.ts
+++ b/src/queries/analytics/events/getEventUsage.ts
@@ -8,7 +8,11 @@ export function getEventUsage(...args: [websiteIds: string[], startDate: Date, e
});
}
-function clickhouseQuery(websiteIds: string[], startDate: Date, endDate: Date) {
+function clickhouseQuery(
+ websiteIds: string[],
+ startDate: Date,
+ endDate: Date,
+): Promise<{ websiteId: string; count: number }[]> {
const { rawQuery } = clickhouse;
return rawQuery(
@@ -26,5 +30,9 @@ function clickhouseQuery(websiteIds: string[], startDate: Date, endDate: Date) {
startDate,
endDate,
},
- );
+ ).then(a => {
+ return Object.values(a).map(a => {
+ return { websiteId: a.websiteId, count: Number(a.count) };
+ });
+ });
}