finish CH query and clean up objects

This commit is contained in:
Francis Cao 2023-08-08 11:57:58 -07:00
parent 15575d7783
commit bf507037c7
4 changed files with 109 additions and 152 deletions

View file

@ -7,12 +7,10 @@ import { getRetention } from 'queries';
export interface RetentionRequestBody {
websiteId: string;
window: string;
dateRange: { window; startDate: string; endDate: string };
}
export interface RetentionResponse {
window: string;
startAt: number;
endAt: number;
}
@ -27,7 +25,6 @@ export default async (
if (req.method === 'POST') {
const {
websiteId,
window,
dateRange: { startDate, endDate },
} = req.body;
@ -38,7 +35,6 @@ export default async (
const data = await getRetention(websiteId, {
startDate: new Date(startDate),
endDate: new Date(endDate),
window: window,
});
return ok(res, data);