Scheduling infrastructure for absolutely everyone.
fix (#17548)
Anik Dhabal Babu42a264380a6c
diff --git a/packages/trpc/server/routers/viewer/slots/util.ts b/packages/trpc/server/routers/viewer/slots/util.tsindex ccdc76a6b0f..ecd1ebb18f0 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<Iif (!startTime.isValid() || !endTime.isValid()) {throw new TRPCError({ message: "Invalid time range given.", code: "BAD_REQUEST" });}- let currentSeats: CurrentSeats | undefined;const eventHosts: {isFixed: boolean;@@ -497,7 +496,7 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise<IcontactOwnerEmail,});- let { aggregatedAvailability, allUsersAvailability, usersWithCredentials } =+ let { aggregatedAvailability, allUsersAvailability, usersWithCredentials, currentSeats } =await calculateHostsAndAvailabilities({input,eventType,@@ -506,7 +505,6 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise<IloggerWithEventDetails,startTime,endTime,- currentSeats,bypassBusyCalendarTimes,});@@ -522,7 +520,7 @@ async function _getAvailableSlots({ input, ctx }: GetScheduleOptions): Promise<Iif (routedHostsAndFixedHosts.length > 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<IloggerWithEventDetails,startTime,endTime,- currentSeats,bypassBusyCalendarTimes,}));}@@ -1016,7 +1013,6 @@ const calculateHostsAndAvailabilities = async ({loggerWithEventDetails,startTime,endTime,- currentSeats,bypassBusyCalendarTimes,}: {input: TGetScheduleInputSchema;@@ -1029,7 +1025,6 @@ const calculateHostsAndAvailabilities = async ({loggerWithEventDetails: Logger<unknown>;startTime: ReturnType<typeof getStartTime>;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 };};