diff --git a/apps/web/pages/api/book/event.ts b/apps/web/pages/api/book/event.ts index ec99dfcac2..79f7f43cff 100644 --- a/apps/web/pages/api/book/event.ts +++ b/apps/web/pages/api/book/event.ts @@ -458,11 +458,26 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }); const credentials = currentUser.credentials; + const calendarBusyTimes: EventBusyDate[] = await prisma.booking .findMany({ where: { - userId: currentUser.id, - eventTypeId: eventTypeId, + AND: [ + { + userId: currentUser.id, + eventTypeId: eventTypeId, + }, + { + OR: [ + { + status: "ACCEPTED", + }, + { + status: "PENDING", + }, + ], + }, + ], }, }) .then((bookings) => bookings.map((booking) => ({ end: booking.endTime, start: booking.startTime })));