clean-up hooks for passing uneccessary date params
This commit is contained in:
@@ -3,6 +3,7 @@ import { parseRequest } from '@/lib/request';
|
||||
import { badRequest, json, ok, unauthorized } from '@/lib/response';
|
||||
import { deleteTeamUser, getTeamUser, updateTeamUser } from '@/queries/prisma';
|
||||
import { z } from 'zod';
|
||||
import { teamRoleParam } from '@/lib/schema';
|
||||
|
||||
export async function GET(
|
||||
request: Request,
|
||||
@@ -30,7 +31,7 @@ export async function POST(
|
||||
{ params }: { params: Promise<{ teamId: string; userId: string }> },
|
||||
) {
|
||||
const schema = z.object({
|
||||
role: z.string().regex(/team-member|team-view-only|team-manager/),
|
||||
role: teamRoleParam,
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
||||
@@ -11,7 +11,6 @@ export async function GET(
|
||||
{ params }: { params: Promise<{ websiteId: string }> },
|
||||
) {
|
||||
const schema = z.object({
|
||||
compare: z.string().optional(),
|
||||
...dateRangeParams,
|
||||
...filterParams,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user