Update pages/api/availability/_get.ts
add select: availabilitUserSelect Co-authored-by: Omar López <zomars@me.com>pull/9078/head
parent
5dbb2066e0
commit
2263e04217
|
@ -31,7 +31,7 @@ async function handler(req: NextApiRequest) {
|
|||
eventTypeId,
|
||||
userId,
|
||||
});
|
||||
const team = await prisma.team.findUnique({ where: { id: teamId }, select: { members: true } });
|
||||
const team = await prisma.team.findUnique({ where: { id: teamId }, select: { members: { select: availabilityUserSelect } } });
|
||||
if (!team) throw new HttpError({ statusCode: 404, message: "teamId not found" });
|
||||
if (!team.members) throw new HttpError({ statusCode: 404, message: "teamId not found" });
|
||||
if (!isAdmin) throw new HttpError({ statusCode: 401, message: "Unauthorized" });
|
||||
|
|
Loading…
Reference in New Issue