fix: don’t let the booking page crash on invalid metadata (#21410)
* fix: booking tab crash * Update zod-utils.ts * Update zod-utils.ts * update
This commit is contained in:
1 parent
3e8f0b125d
commit
f1dd217de7
2 files changed
+6
-2
No files matched your search
@@ -129,7 +129,9 @@ export default function Success(props: PageProps) {
|
||||
rescheduleLocation = bookingInfo.responses.location.optionValue;
|
||||
}
|
||||
|
||||
const parsedBookingMetadata = bookingMetadataSchema.parse(bookingInfo?.metadata || {});
|
||||
const parsed = bookingMetadataSchema.safeParse(bookingInfo?.metadata ?? null);
|
||||
const parsedBookingMetadata = parsed.success ? parsed.data : null;
|
||||
|
||||
const bookingWithParsedMetadata = {
|
||||
...bookingInfo,
|
||||
metadata: parsedBookingMetadata,
|
||||
|
||||
Reference in new issue
Block a user