fix: dry run improvements for v2 (#19196)

* add dry run param for v2 getSlots

* fixup

* revert changes

* dont reserve a slot for booking dry run

* accept dry run prop as a parameter instead of computing

* fix merge conflicts

* fixup

* dont reserve slots for booking dry run
This commit is contained in:
Rajiv Sahal authored and GitHub committed 2025-03-07 14:49:54 +05:30
1 parent 04c581a25e
commit 870cadd81f
4 files changed
+16 -5

No files matched your search

@@ -1,10 +1,8 @@
import { EventTypesRepository_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/event-types.repository";
import { SlotsRepository_2024_04_15 } from "@/modules/slots/slots-2024-04-15/slots.repository";
import { Injectable, NotFoundException, BadRequestException } from "@nestjs/common";
import { DateTime } from "luxon";
import { Injectable, NotFoundException } from "@nestjs/common";
import { v4 as uuid } from "uuid";
import { SlotFormat } from "@calcom/platform-enums";
import { ReserveSlotInput_2024_04_15 } from "@calcom/platform-types";
@Injectable()
@@ -33,7 +31,7 @@ export class SlotsService_2024_04_15 {
}
}
if (eventType && shouldReserveSlot) {
if (eventType && shouldReserveSlot && !input._isDryRun) {
await Promise.all(
eventType.users.map((user) =>
this.slotsRepo.upsertSelectedSlot(user.id, input, uid, eventType.seatsPerTimeSlot !== null)