Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Oct 17, 2023
2 parents a43422d + e3df177 commit 4c57c32
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/queries/analytics/events/getEventUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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) };
});
});
}

0 comments on commit 4c57c32

Please sign in to comment.