From 49b1d0a1252357a39620ed7688f3b89e839b1634 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Tue, 14 May 2024 12:01:27 -0700 Subject: [PATCH] fix usage. --- src/pages/api/users/[userId]/usage.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/api/users/[userId]/usage.ts b/src/pages/api/users/[userId]/usage.ts index 90cfb9ee..547de338 100644 --- a/src/pages/api/users/[userId]/usage.ts +++ b/src/pages/api/users/[userId]/usage.ts @@ -6,8 +6,9 @@ import { getAllUserWebsitesIncludingTeamOwner, getEventDataUsage, getEventUsage import * as yup from 'yup'; export interface UserUsageRequestQuery { - id: string; - params: { startAt: string; endAt: string }; + userId: string; + startAt: string; + endAt: string; } export interface UserUsageRequestResponse { @@ -44,7 +45,7 @@ export default async ( return unauthorized(res); } - const { id: userId, startAt, endAt } = req.query; + const { userId, startAt, endAt } = req.query; const startDate = new Date(+startAt); const endDate = new Date(+endAt);