Updated report schemas. Removed yup.
This commit is contained in:
1 parent
edd72cd6e3
commit
f3e733dea3
13 files changed
+37
-146
No files matched your search
@@ -3,16 +3,11 @@ import { canViewWebsite } from 'lib/auth';
|
||||
import { unauthorized, json } from 'lib/response';
|
||||
import { parseRequest } from 'lib/request';
|
||||
import { getUTM } from 'queries';
|
||||
import { timezoneParam } from 'lib/schema';
|
||||
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(),
|
||||
timezone: timezoneParam,
|
||||
}),
|
||||
...reportParms,
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
||||
Reference in new issue
Block a user