From 83678dfea22f59b673ef0b88d6b2719b4a645a5e Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Wed, 2 Aug 2023 16:15:32 +0100 Subject: [PATCH] Revert "fix: weekly limits (#10404)" This reverts commit 1d5b383529a6073b7c8e4cf2cb6372c7f59e3228. --- packages/core/getUserAvailability.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/core/getUserAvailability.ts b/packages/core/getUserAvailability.ts index 49fbb71944..044e3478b0 100644 --- a/packages/core/getUserAvailability.ts +++ b/packages/core/getUserAvailability.ts @@ -42,7 +42,6 @@ const getEventType = async (id: number) => { bookingLimits: true, durationLimits: true, timeZone: true, - length: true, metadata: true, schedule: { select: { @@ -166,9 +165,8 @@ export async function getUserAvailability( const busyTimes = await getBusyTimes({ credentials: user.credentials, - // needed to correctly apply limits (weeks can be part of two months) - startTime: dateFrom.startOf("week").toISOString(), - endTime: dateTo.endOf("week").toISOString(), + startTime: dateFrom.toISOString(), + endTime: dateTo.toISOString(), eventTypeId, userId: user.id, username: `${user.username}`, @@ -376,7 +374,7 @@ const getBusyTimesFromDurationLimits = async ( // loop through all dates and check if we have reached the limit for (const date of dates) { - let total = (duration || eventType?.length) ?? 0; + let total = duration ?? 0; const startDate = date.startOf(filter); const endDate = date.endOf(filter);