fix: unable to cancel seated event due to booking responses (#23447)

* fix: unable to cancel event

* Update editLocation.handler.ts
This commit is contained in:
Anik Dhabal Babu
2025-08-29 18:15:06 +00:00
committed by GitHub
parent 1fd1202373
commit 28f473da14
@@ -87,6 +87,7 @@ async function updateBookingLocationInDb({
evt: Ensure<CalendarEvent, "location">;
references: PartialReference[];
}) {
const isSeatedEvent = !!evt.seatsPerTimeSlot;
const bookingMetadataUpdate = {
videoCallUrl: getVideoCallUrlFromCalEvent(evt),
};
@@ -97,6 +98,13 @@ async function updateBookingLocationInDb({
...(credentialId && credentialId > 0 ? { credentialId } : {}),
};
});
const responses = {
...(typeof booking.responses === "object" && booking.responses),
location: {
value: evt.location,
optionValue: "",
},
};
const bookingRepository = new BookingRepository(prisma);
await bookingRepository.updateLocationById({
@@ -108,13 +116,7 @@ async function updateBookingLocationInDb({
...bookingMetadataUpdate,
},
referencesToCreate,
responses: {
...(typeof booking.responses === "object" && booking.responses),
location: {
value: evt.location,
optionValue: "",
},
},
...(!isSeatedEvent ? { responses } : {}),
iCalSequence: (evt.iCalSequence || 0) + 1,
},
});