Skip to content

Commit

Permalink
Better fix, usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
briancao committed Oct 20, 2023
1 parent ec0a3fa commit beac035
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) };
});
});
}

2 comments on commit beac035

@vercel
Copy link

@vercel vercel bot commented on beac035 Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on beac035 Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.