fix: Zod error caused by number-type responses (#23804)

* fix: getting zoderror due to number type responses

* update

* fix lint erro
This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2025-09-17 15:01:21 +00:00
1 parent 81bd8033a9
commit bb6f5cca93
2 files changed
+4 -11

No files matched your search

@@ -1,5 +1,3 @@
import type { z } from "zod";
import { bookingResponsesDbSchema } from "@calcom/features/bookings/lib/getBookingResponsesSchema";
import slugify from "@calcom/lib/slugify";
import type { PrismaClient } from "@calcom/prisma";
@@ -115,10 +113,8 @@ export const getBookingWithResponses = <
) => {
return {
...booking,
responses: isSeatedEvent
? bookingResponsesDbSchema.parse(booking.responses || {})
: bookingResponsesDbSchema.parse(booking.responses || getResponsesFromOldBooking(booking)),
} as Omit<T, "responses"> & { responses: z.infer<typeof bookingResponsesDbSchema> };
responses: isSeatedEvent ? booking.responses : booking.responses || getResponsesFromOldBooking(booking),
} as Omit<T, "responses"> & { responses: Record<string, any> };
};
export default getBooking;