Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix event-data calls.

Brian Cao2683ff278a59
diff --git a/src/pages/api/event-data/events.ts b/src/pages/api/event-data/events.ts
index da0afc65d..1d1d37877 100644
--- a/src/pages/api/event-data/events.ts
+++ b/src/pages/api/event-data/events.ts
@@ -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(),
}),
};
diff --git a/src/pages/api/event-data/stats.ts b/src/pages/api/event-data/stats.ts
index b7b70dbfe..7f694bc62 100644
--- a/src/pages/api/event-data/stats.ts
+++ b/src/pages/api/event-data/stats.ts
@@ -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 {