fix: rr-host booked outside of availability (#12704)

* correctly query overlapping bookings

* remove console.log

* fix getting busy bookings for getAvailableSlots

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
This commit is contained in:
Carina Wollendorfer 2023-12-08 01:31:02 +00:00 committed by GitHub
parent c53e891c8a
commit f87eac193f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,6 @@ test.describe("Organization", () => {
// Code verification
await expect(page.locator("#modal-title")).toBeVisible();
await page.locator("input[name='2fa1']").fill(generateTotpCode(`john@${orgDomain}.com`));
await page.locator("button:text('Verify')").click();
// Check admin email about DNS pending action
await expectInvitationEmailToBeReceived(

View File

@ -83,9 +83,10 @@ export async function getBusyTimes(params: {
const endTimeDate =
rescheduleUid && duration ? dayjs(endTime).add(duration, "minute").toDate() : new Date(endTime);
// startTime is less than endTimeDate and endTime grater than startTimeDate
const sharedQuery = {
startTime: { gte: startTimeDate },
endTime: { lte: endTimeDate },
startTime: { lte: endTimeDate },
endTime: { gte: startTimeDate },
status: {
in: [BookingStatus.ACCEPTED],
},

View File

@ -328,8 +328,8 @@ export async function getAvailableSlots({ input, ctx }: GetScheduleOptions) {
input.rescheduleUid && durationToUse ? endTime.add(durationToUse, "minute").toDate() : endTime.toDate();
const sharedQuery = {
startTime: { gte: startTimeDate },
endTime: { lte: endTimeDate },
startTime: { lte: endTimeDate },
endTime: { gte: startTimeDate },
status: {
in: [BookingStatus.ACCEPTED],
},