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 20, 2023
2 parents f175534 + 4153db4 commit 0901a00
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/queries/analytics/eventData/getEventDataUsage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export function getEventDataUsage(...args: [websiteIds: string[], startDate: Dat
});
}

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 0901a00

Please sign in to comment.