Cleanup
parent
3273876fd3
commit
c3675f12ae
|
@ -143,6 +143,7 @@ export async function getBusyTimes(params: {
|
|||
|
||||
getBookingsSpan.end();
|
||||
|
||||
const calculateBusyTimesSpan = tracer.startSpan("busyTimes-" + userId, undefined, context.active());
|
||||
const bookingSeatCountMap: { [x: string]: number } = {};
|
||||
const busyTimes = bookings.reduce(
|
||||
(aggregate: EventBusyDetails[], { id, startTime, endTime, eventType, title, ...rest }) => {
|
||||
|
|
|
@ -170,11 +170,6 @@ export const getUserAvailability = async function getUsersWorkingHoursLifeTheUni
|
|||
|
||||
const bookingLimits = parseBookingLimit(eventType?.bookingLimits);
|
||||
const durationLimits = parseDurationLimit(eventType?.durationLimits);
|
||||
|
||||
// TODO: only query what we need after applying limits (shrink date range)
|
||||
const getBusyTimesStart = dateFrom.toISOString();
|
||||
const getBusyTimesEnd = dateTo.toISOString();
|
||||
|
||||
const busyTimesFromLimits =
|
||||
eventType && (bookingLimits || durationLimits)
|
||||
? await getBusyTimesFromLimits(
|
||||
|
@ -188,6 +183,9 @@ export const getUserAvailability = async function getUsersWorkingHoursLifeTheUni
|
|||
)
|
||||
: [];
|
||||
|
||||
// TODO: only query what we need after applying limits (shrink date range)
|
||||
const getBusyTimesStart = dateFrom.toISOString();
|
||||
const getBusyTimesEnd = dateTo.toISOString();
|
||||
const getBusyTimesSpan = tracer.startSpan("getBusyTimes-" + user.id, undefined, context.active());
|
||||
const busyTimes = await getBusyTimes({
|
||||
credentials: user.credentials,
|
||||
|
|
Loading…
Reference in New Issue