File tree Expand file tree Collapse file tree
packages/trpc/server/routers/viewer/bookings Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments