fix: booking limits for team event types (#14135)

* use bookings from all users

* add same changes to handleNewBooking

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
This commit is contained in:
Carina Wollendorfer
2024-03-19 13:12:09 +05:30
committed by GitHub
co-authored by CarinaWolli
parent ece74cbc49
commit aaf630ed18
2 changed files with 2 additions and 4 deletions
@@ -371,7 +371,7 @@ export async function ensureAvailableUsers(
user,
eventType,
rescheduleUid: input.originalRescheduledBooking?.uid ?? null,
busyTimesFromLimitsBookings: busyTimesFromLimitsBookingsAllUsers.filter((b) => b.userId === user.id),
busyTimesFromLimitsBookings: busyTimesFromLimitsBookingsAllUsers,
}
);
@@ -472,9 +472,7 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
const { attendees: _attendees, ...bookingWithoutAttendees } = bookings;
return bookingWithoutAttendees;
}),
busyTimesFromLimitsBookings: busyTimesFromLimitsBookingsAllUsers.filter(
(b) => b.userId === currentUser.id
),
busyTimesFromLimitsBookings: busyTimesFromLimitsBookingsAllUsers,
}
);
if (!currentSeats && _currentSeats) currentSeats = _currentSeats;