clean-up event/event-data endpoints. fix for expanded view for mobile

This commit is contained in:
Francis Cao 2025-10-15 11:32:19 -07:00
parent 9df012084d
commit a2b1089e62
8 changed files with 47 additions and 21 deletions

View file

@ -1,16 +1,17 @@
import { z } from 'zod';
import { getQueryFilters, parseRequest } from '@/lib/request';
import { unauthorized, json } from '@/lib/response';
import { json, unauthorized } from '@/lib/response';
import { filterParams, pagingParams, searchParams } from '@/lib/schema';
import { canViewWebsite } from '@/permissions';
import { dateRangeParams, pagingParams, filterParams, searchParams } from '@/lib/schema';
import { getWebsiteEvents } from '@/queries/sql';
import { z } from 'zod';
export async function GET(
request: Request,
{ params }: { params: Promise<{ websiteId: string }> },
) {
const schema = z.object({
...dateRangeParams,
startAt: z.coerce.number().optional(),
endAt: z.coerce.number().optional(),
...filterParams,
...pagingParams,
...searchParams,