diff --git a/pages/api/attendees/[id].ts b/pages/api/attendees/[id].ts index 03133bf526..6931c5d6df 100644 --- a/pages/api/attendees/[id].ts +++ b/pages/api/attendees/[id].ts @@ -100,7 +100,7 @@ export async function attendeeById(req: NextApiRequest, res: NextApiResponse booking.attendees).flat(); const attendeeIds = attendees.map((attendee) => attendee.id); // Here we make sure to only return attendee's of the user's own bookings. - if (!attendeeIds.includes(safeQuery.data.id)) res.status(401).json({ message: "Unauthorized" }); + if (!attendeeIds.includes(safeQuery.data.id)) res.status(401).json({ message: "Unauthorized" }); else { switch (method) { case "GET": diff --git a/pages/api/schedules/[id].ts b/pages/api/schedules/[id].ts index a8fa501412..9a6f67d826 100644 --- a/pages/api/schedules/[id].ts +++ b/pages/api/schedules/[id].ts @@ -126,6 +126,20 @@ export async function scheduleById(req: NextApiRequest, res: NextApiResponse diff --git a/pages/api/users/[id].ts b/pages/api/users/[id].ts index e1a11b3004..58fb826521 100644 --- a/pages/api/users/[id].ts +++ b/pages/api/users/[id].ts @@ -91,7 +91,7 @@ export async function userById(req: NextApiRequest, res: NextApiResponse