From 3a1d8b8183f39ee4110f4151f16aa55dd62fb34e Mon Sep 17 00:00:00 2001 From: zomars Date: Mon, 23 May 2022 09:29:19 -0600 Subject: [PATCH] Merge production to main --- apps/web/pages/api/availability/[user].ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/pages/api/availability/[user].ts b/apps/web/pages/api/availability/[user].ts index 6e45678cce..324e5f12cc 100644 --- a/apps/web/pages/api/availability/[user].ts +++ b/apps/web/pages/api/availability/[user].ts @@ -16,7 +16,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const user = asStringOrNull(req.query.user); const dateFrom = dayjs(asStringOrNull(req.query.dateFrom)); const dateTo = dayjs(asStringOrNull(req.query.dateTo)); - const eventTypeId = parseInt(asStringOrNull(req.query.eventTypeId) || ""); + const eventTypeId = typeof req.query.eventTypeId === "string" ? parseInt(req.query.eventTypeId) : undefined; if (!dateFrom.isValid() || !dateTo.isValid()) { return res.status(400).json({ message: "Invalid time range given." });