diff --git a/apps/api/pages/api/slots/_get.ts b/apps/api/pages/api/slots/_get.ts index 61447e1751..4c2d209464 100644 --- a/apps/api/pages/api/slots/_get.ts +++ b/apps/api/pages/api/slots/_get.ts @@ -22,7 +22,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { const { usernameList, ...rest } = req.query; let slugs = usernameList; if (!Array.isArray(usernameList)) { - slugs = usernameList ? [usernameList] : []; + slugs = usernameList ? [usernameList] : undefined; } const input = getScheduleSchema.parse({ usernameList: slugs, ...rest }); const timeZoneSupported = input.timeZone ? isSupportedTimeZone(input.timeZone) : false; @@ -40,7 +40,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { ) : availableSlots; - return slotsInProvidedTimeZone; + return { slots: slotsInProvidedTimeZone }; // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (cause) { if (cause instanceof TRPCError) {