Fix usage.

This commit is contained in:
Brian Cao 2024-05-13 15:43:53 -07:00
parent 98a0a83ccf
commit 25dd94b551
2 changed files with 24 additions and 2 deletions

View file

@ -2,7 +2,7 @@ import { useAuth, useCors, useValidate } from 'lib/middleware';
import { NextApiRequestQueryBody } from 'lib/types';
import { NextApiResponse } from 'next';
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
import { getAllWebsites, getEventDataUsage, getEventUsage } from 'queries';
import { getAllUserWebsitesIncludingTeamOwner, getEventDataUsage, getEventUsage } from 'queries';
import * as yup from 'yup';
export interface UserUsageRequestQuery {
@ -50,7 +50,7 @@ export default async (
const startDate = new Date(+startAt);
const endDate = new Date(+endAt);
const websites = await getAllWebsites(userId);
const websites = await getAllUserWebsitesIncludingTeamOwner(userId);
const websiteIds = websites.map(a => a.id);