Updated filtering logic.

This commit is contained in:
Mike Cao 2023-08-07 12:43:43 -07:00
parent 112005212e
commit 9d86385f5c
8 changed files with 23 additions and 31 deletions

View file

@ -21,7 +21,7 @@ export default async (
await useAuth(req, res);
if (req.method === 'GET') {
const { websiteId, startAt, endAt, eventName } = req.query;
const { websiteId, startAt, endAt, event } = req.query;
if (!(await canViewWebsite(req.auth, websiteId))) {
return unauthorized(res);
@ -33,7 +33,7 @@ export default async (
const data = await getEventDataEvents(websiteId, {
startDate,
endDate,
eventName,
event,
});
return ok(res, data);