fix session values route
This commit is contained in:
@@ -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 { 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(
|
export async function GET(
|
||||||
request: Request,
|
request: Request,
|
||||||
@@ -20,7 +20,7 @@ export async function GET(
|
|||||||
return error();
|
return error();
|
||||||
}
|
}
|
||||||
|
|
||||||
const { startAt, endAt, event } = query;
|
const { startAt, endAt, propertyName } = query;
|
||||||
const { websiteId } = await params;
|
const { websiteId } = await params;
|
||||||
|
|
||||||
if (!(await canViewWebsite(auth, websiteId))) {
|
if (!(await canViewWebsite(auth, websiteId))) {
|
||||||
@@ -30,10 +30,10 @@ export async function GET(
|
|||||||
const startDate = new Date(+startAt);
|
const startDate = new Date(+startAt);
|
||||||
const endDate = new Date(+endAt);
|
const endDate = new Date(+endAt);
|
||||||
|
|
||||||
const data = await getEventDataEvents(websiteId, {
|
const data = await getSessionDataValues(websiteId, {
|
||||||
startDate,
|
startDate,
|
||||||
endDate,
|
endDate,
|
||||||
event,
|
propertyName,
|
||||||
});
|
});
|
||||||
|
|
||||||
return json(data);
|
return json(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user