Updated report schemas. Removed yup.

This commit is contained in:
Mike Cao 2025-01-31 23:46:23 -08:00
parent edd72cd6e3
commit f3e733dea3
13 changed files with 37 additions and 146 deletions

View file

@ -3,14 +3,11 @@ import { canViewWebsite } from 'lib/auth';
import { unauthorized, json } from 'lib/response';
import { parseRequest } from 'lib/request';
import { getJourney } from 'queries';
import { reportParms } from 'lib/schema';
export async function POST(request: Request) {
const schema = z.object({
websiteId: z.string().uuid(),
dateRange: z.object({
startDate: z.date(),
endDate: z.date(),
}),
...reportParms,
steps: z.number().min(3).max(7),
startStep: z.string(),
endStep: z.string(),