Zen components conversion.

This commit is contained in:
Mike Cao 2025-03-07 03:11:58 -08:00
parent aac1a12e51
commit 5999bf6256
142 changed files with 1235 additions and 1454 deletions

View file

@ -2,7 +2,7 @@ import { z } from 'zod';
import { unauthorized, json, badRequest } from '@/lib/response';
import { canAddUserToTeam, canViewTeam } from '@/lib/auth';
import { parseRequest } from '@/lib/request';
import { pagingParams, roleParam } from '@/lib/schema';
import { pagingParams, teamRoleParam } from '@/lib/schema';
import { createTeamUser, getTeamUser, getTeamUsers } from '@/queries';
export async function GET(request: Request, { params }: { params: Promise<{ teamId: string }> }) {
@ -48,7 +48,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ team
export async function POST(request: Request, { params }: { params: Promise<{ teamId: string }> }) {
const schema = z.object({
userId: z.string().uuid(),
role: roleParam,
role: teamRoleParam,
});
const { auth, body, error } = await parseRequest(request, schema);