diff --git a/packages/lib/bookings/filterHostsByLeadThreshold.test.ts b/packages/lib/bookings/filterHostsByLeadThreshold.test.ts index eae55c09a40a12..f8ca3ceac2531e 100644 --- a/packages/lib/bookings/filterHostsByLeadThreshold.test.ts +++ b/packages/lib/bookings/filterHostsByLeadThreshold.test.ts @@ -114,10 +114,8 @@ describe("filterHostByLeadThreshold", () => { where: { OR: [ { - user: { - id: { - in: [2], - }, + userId: { + in: [2], }, OR: [ { diff --git a/packages/lib/server/repository/booking.ts b/packages/lib/server/repository/booking.ts index 89bd95fdce640a..941c2c5abe7c7b 100644 --- a/packages/lib/server/repository/booking.ts +++ b/packages/lib/server/repository/booking.ts @@ -44,10 +44,8 @@ const buildWhereClauseForActiveBookings = ({ }): Prisma.BookingWhereInput => ({ OR: [ { - user: { - id: { - in: users.map((user) => user.id), - }, + userId: { + in: users.map((user) => user.id), }, OR: [ { diff --git a/packages/trpc/server/routers/viewer/slots/util.ts b/packages/trpc/server/routers/viewer/slots/util.ts index 0584e66f1ada58..d9dfff3a5a897c 100644 --- a/packages/trpc/server/routers/viewer/slots/util.ts +++ b/packages/trpc/server/routers/viewer/slots/util.ts @@ -986,22 +986,18 @@ const calculateHostsAndAvailabilities = async ({ }; const allUserIds = usersWithCredentials.map((user) => user.id); - const currentBookingsAllUsers = await monitorCallbackAsync( - getExistingBookings, - startTimeDate, - endTimeDate, - eventType, - sharedQuery, - usersWithCredentials, - allUserIds - ); - - const outOfOfficeDaysAllUsers = await monitorCallbackAsync( - getOOODates, - startTimeDate, - endTimeDate, - allUserIds - ); + const [currentBookingsAllUsers, outOfOfficeDaysAllUsers] = await Promise.all([ + monitorCallbackAsync( + getExistingBookings, + startTimeDate, + endTimeDate, + eventType, + sharedQuery, + usersWithCredentials, + allUserIds + ), + monitorCallbackAsync(getOOODates, startTimeDate, endTimeDate, allUserIds), + ]); const bookingLimits = parseBookingLimit(eventType?.bookingLimits); const durationLimits = parseDurationLimit(eventType?.durationLimits);