remove duplicated error check in event-types id

pull/9078/head
Agusti Fernandez Pardo 2022-04-20 20:25:26 +02:00
parent 12dbb0ad03
commit e138df47ba
1 changed files with 0 additions and 1 deletions

View File

@ -97,7 +97,6 @@ export async function eventTypeById(req: NextApiRequest, res: NextApiResponse<Ev
const safeQuery = schemaQueryIdParseInt.safeParse(query);
const safeBody = schemaEventTypeBodyParams.safeParse(body);
if (!safeQuery.success) throw new Error("Invalid request query", safeQuery.error);
if (!safeQuery.success) throw new Error("Invalid request query", safeQuery.error);
const userId = await getCalcomUserId(res);
const data = await prisma.eventType.findMany({ where: { userId } });
const userEventTypes = data.map((eventType) => eventType.id);