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 session values route

Francis Cao1438231898b8
diff --git a/src/app/api/websites/[websiteId]/session-data/values/route.ts b/src/app/api/websites/[websiteId]/session-data/values/route.ts
index 93e91775e..d950da340 100644
--- a/src/app/api/websites/[websiteId]/session-data/values/route.ts
+++ b/src/app/api/websites/[websiteId]/session-data/values/route.ts
@@ -1,8 +1,8 @@
-import { z } from 'zod';
-import { parseRequest } from '@/lib/request';
-import { unauthorized, json } from '@/lib/response';
import { canViewWebsite } from '@/lib/auth';
-import { getEventDataEvents } from '@/queries/sql/events/getEventDataEvents';
+import { parseRequest } from '@/lib/request';
+import { json, unauthorized } from '@/lib/response';
+import { getSessionDataValues } from '@/queries';
+import { z } from 'zod';
export async function GET(
request: Request,
@@ -20,7 +20,7 @@ export async function GET(
return error();
}
- const { startAt, endAt, event } = query;
+ const { startAt, endAt, propertyName } = query;
const { websiteId } = await params;
if (!(await canViewWebsite(auth, websiteId))) {
@@ -30,10 +30,10 @@ export async function GET(
const startDate = new Date(+startAt);
const endDate = new Date(+endAt);
- const data = await getEventDataEvents(websiteId, {
+ const data = await getSessionDataValues(websiteId, {
startDate,
endDate,
- event,
+ propertyName,
});
return json(data);