Fix event-data calls.

This commit is contained in:
Brian Cao 2023-08-24 12:55:15 -07:00
parent 9180a7008b
commit 2683ff278a
2 changed files with 3 additions and 2 deletions

View File

@ -10,7 +10,7 @@ export interface EventDataFieldsRequestQuery {
websiteId: string;
startAt: string;
endAt: string;
event: string;
event?: string;
}
const schema = {
@ -18,7 +18,7 @@ const schema = {
websiteId: yup.string().uuid().required(),
startAt: yup.number().integer().required(),
endAt: yup.number().integer().moreThan(yup.ref('startAt')).required(),
event: yup.string().required(),
event: yup.string(),
}),
};

View File

@ -3,6 +3,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 { getEventDataStats } from 'queries/index';
import * as yup from 'yup';
export interface EventDataStatsRequestQuery {