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 { getGoals } from 'queries/analytics/reports/getGoals';
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,
goals: z
.array(
z.object({