File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,7 +87,9 @@ function buildParsedBooking(booking: BookingItemProps) {
8787 > )
8888 : null ;
8989
90- const bookingMetadata = bookingMetadataSchema . parse ( booking . metadata ?? null ) ;
90+ const parsedMetadata = bookingMetadataSchema . safeParse ( booking . metadata ?? null ) ;
91+ const bookingMetadata = parsedMetadata . success ? parsedMetadata . data : null ;
92+
9193 return {
9294 ...booking ,
9395 eventType : bookingEventType ,
Original file line number Diff line number Diff line change @@ -129,7 +129,9 @@ export default function Success(props: PageProps) {
129129 rescheduleLocation = bookingInfo . responses . location . optionValue ;
130130 }
131131
132- const parsedBookingMetadata = bookingMetadataSchema . parse ( bookingInfo ?. metadata || { } ) ;
132+ const parsed = bookingMetadataSchema . safeParse ( bookingInfo ?. metadata ?? null ) ;
133+ const parsedBookingMetadata = parsed . success ? parsed . data : null ;
134+
133135 const bookingWithParsedMetadata = {
134136 ...bookingInfo ,
135137 metadata : parsedBookingMetadata ,
You can’t perform that action at this time.
0 commit comments