Skip to content

Commit 28f473d

Browse files
authored
fix: unable to cancel seated event due to booking responses (calcom#23447)
* fix: unable to cancel event * Update editLocation.handler.ts
1 parent 1fd1202 commit 28f473d

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

packages/trpc/server/routers/viewer/bookings/editLocation.handler.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ async function updateBookingLocationInDb({
8787
evt: Ensure<CalendarEvent, "location">;
8888
references: PartialReference[];
8989
}) {
90+
const isSeatedEvent = !!evt.seatsPerTimeSlot;
9091
const bookingMetadataUpdate = {
9192
videoCallUrl: getVideoCallUrlFromCalEvent(evt),
9293
};
@@ -97,6 +98,13 @@ async function updateBookingLocationInDb({
9798
...(credentialId && credentialId > 0 ? { credentialId } : {}),
9899
};
99100
});
101+
const responses = {
102+
...(typeof booking.responses === "object" && booking.responses),
103+
location: {
104+
value: evt.location,
105+
optionValue: "",
106+
},
107+
};
100108

101109
const bookingRepository = new BookingRepository(prisma);
102110
await bookingRepository.updateLocationById({
@@ -108,13 +116,7 @@ async function updateBookingLocationInDb({
108116
...bookingMetadataUpdate,
109117
},
110118
referencesToCreate,
111-
responses: {
112-
...(typeof booking.responses === "object" && booking.responses),
113-
location: {
114-
value: evt.location,
115-
optionValue: "",
116-
},
117-
},
119+
...(!isSeatedEvent ? { responses } : {}),
118120
iCalSequence: (evt.iCalSequence || 0) + 1,
119121
},
120122
});

0 commit comments

Comments
 (0)