fix zod validations and prisma query for admin teams
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
import { uuid } from '@/lib/crypto';
|
||||
import { pagingParams, reportSchema } from '@/lib/schema';
|
||||
import { pagingParams, reportSchema, reportTypeParam } from '@/lib/schema';
|
||||
import { parseRequest } from '@/lib/request';
|
||||
import { canViewWebsite, canUpdateWebsite } from '@/permissions';
|
||||
import { unauthorized, json } from '@/lib/response';
|
||||
@@ -9,7 +9,7 @@ import { getReports, createReport } from '@/queries/prisma';
|
||||
export async function GET(request: Request) {
|
||||
const schema = z.object({
|
||||
websiteId: z.uuid(),
|
||||
type: z.string().optional(),
|
||||
type: reportTypeParam.optional(),
|
||||
...pagingParams,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user