hunk.code_window:     where: { id: teamId, members: { some: { userId, role: { in: ["OWNER", "ADMIN"] } } } },
     });
     if (!_team) throw new HttpError({ statusCode: 401, message: "Unauthorized: OWNER or ADMIN required" });
     const team = await prisma.team.update({ where: { id: teamId }, data });
     return { team: schemaTeamReadPublic.parse(team) };
   }
   export default defaultResponder(patchHandler);
hunk.labels: keep keep keep replace keep keep keep keep
hunk.after_edit:   // TODO: Perhaps there is a better fix for this?
     const cloneData: typeof data & {
       metadata: NonNullable<typeof data.metadata> | undefined;
     } = {
       ...data,
       metadata: data.metadata === null ? {} : data.metadata || undefined,
     };
     const team = await prisma.team.update({ where: { id: teamId }, data: cloneData });
  
hunk.file_path: pages/api/teams/[teamId]/_patch.ts
hunk.type: replace
file: import { z } from "zod";
  
  import { _AttendeeModel as Attendee } from "@calcom/prisma/zod";
  
  import { timeZone } from "@lib/validations/shared/timeZone";
  
  export const schemaAttendeeBaseBodyParams = Attendee.pick({
    bookingId: true,
    email: true,
    name: true,
    timeZone: true,
  });
  
  const schemaAttendeeCreateParams = z
    .object({
      bookingId: z.number().int(),
      email: z.string().email(),
      name: z.string(),
      timeZone: timeZone,
    })
    .strict();
  
  const schemaAttendeeEditParams = z
    .object({
      name: z.string().optional(),
      email: z.string().email().optional(),
      timeZone: timeZone.optional(),
    })
    .strict();
  export const schemaAttendeeEditBodyParams = schemaAttendeeBaseBodyParams.merge(schemaAttendeeEditParams);
  export const schemaAttendeeCreateBodyParams = schemaAttendeeBaseBodyParams.merge(schemaAttendeeCreateParams);
  
  export const schemaAttendeeReadPublic = Attendee.pick({
    id: true,
    bookingId: true,
    name: true,
    email: true,
    timeZone: true,
  });
  