clean-up hooks for passing uneccessary date params
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run

This commit is contained in:
Francis Cao 2025-10-21 16:52:04 -07:00
parent 06230ad2e9
commit b7747b33e4
4 changed files with 20 additions and 8 deletions

View file

@ -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);

View file

@ -11,7 +11,6 @@ export async function GET(
{ params }: { params: Promise<{ websiteId: string }> },
) {
const schema = z.object({
compare: z.string().optional(),
...dateRangeParams,
...filterParams,
});