From 42a264380a6cbfa6c4663ed7e35461a63fad5bf6 Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:07:14 +0530 Subject: [PATCH] fix (#17548) --- packages/trpc/server/routers/viewer/slots/util.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/trpc/server/routers/viewer/slots/util.ts b/packages/trpc/server/routers/viewer/slots/util.ts index ccdc76a6b0..ecd1ebb18f 100644 --- a/packages/trpc/server/routers/viewer/slots/util.ts +++ b/packages/trpc/server/routers/viewer/slots/util.ts @@ -466,7 +466,6 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise 0) { // if the first available slot is more than 2 weeks from now, round robin as normal - ({ aggregatedAvailability, allUsersAvailability, usersWithCredentials } = + ({ aggregatedAvailability, allUsersAvailability, usersWithCredentials, currentSeats } = await calculateHostsAndAvailabilities({ input, eventType, @@ -531,7 +529,6 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise; startTime: ReturnType; endTime: Dayjs; - currentSeats?: CurrentSeats | undefined; bypassBusyCalendarTimes: boolean; }) => { if ( @@ -1063,6 +1058,7 @@ const calculateHostsAndAvailabilities = async ({ }); const durationToUse = input.duration || 0; + let currentSeats: CurrentSeats | undefined; const startTimeDate = input.rescheduleUid && durationToUse @@ -1175,5 +1171,5 @@ const calculateHostsAndAvailabilities = async ({ eventType.schedulingType ); - return { aggregatedAvailability, allUsersAvailability, usersWithCredentials }; + return { aggregatedAvailability, allUsersAvailability, usersWithCredentials, currentSeats }; };