fix: New booker selected date issues (#9570)
* Pick correct selected date * Commented out unused booking page revalidation * Fixed selected default bookerLayout not being applied * Use the right weekdayOfFirst - date(1) of browsingDate
This commit is contained in:
1 parent
bdc5e9c7e9
commit
74671263bf
5 files changed
+16
-14
No files matched your search
@@ -16,7 +16,7 @@ import {
|
||||
EventTypeMetaDataSchema,
|
||||
customInputSchema,
|
||||
userMetadata as userMetadataSchema,
|
||||
bookerLayouts,
|
||||
bookerLayouts as bookerLayoutsSchema,
|
||||
BookerLayouts,
|
||||
} from "@calcom/prisma/zod-utils";
|
||||
|
||||
@@ -69,6 +69,7 @@ const publicEventSelect = Prisma.validator<Prisma.EventTypeSelect>()({
|
||||
username: true,
|
||||
name: true,
|
||||
theme: true,
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
hidden: true,
|
||||
@@ -132,7 +133,7 @@ export const getPublicEvent = async (username: string, eventSlug: string, prisma
|
||||
brandColor: users[0].brandColor,
|
||||
darkBrandColor: users[0].darkBrandColor,
|
||||
theme: null,
|
||||
bookerLayouts: bookerLayouts.parse(
|
||||
bookerLayouts: bookerLayoutsSchema.parse(
|
||||
firstUsersMetadata?.defaultBookerLayouts || defaultEventBookerLayouts
|
||||
),
|
||||
},
|
||||
@@ -167,7 +168,7 @@ export const getPublicEvent = async (username: string, eventSlug: string, prisma
|
||||
|
||||
return {
|
||||
...event,
|
||||
bookerLayouts: bookerLayouts.parse(eventMetaData?.bookerLayouts || null),
|
||||
bookerLayouts: bookerLayoutsSchema.parse(eventMetaData?.bookerLayouts || null),
|
||||
description: markdownToSafeHTML(event.description),
|
||||
metadata: eventMetaData,
|
||||
customInputs: customInputSchema.array().parse(event.customInputs || []),
|
||||
@@ -220,7 +221,7 @@ function getProfileFromEvent(event: Event) {
|
||||
brandColor: profile.brandColor,
|
||||
darkBrandColor: profile.darkBrandColor,
|
||||
theme: profile.theme,
|
||||
bookerLayouts: bookerLayouts.parse(
|
||||
bookerLayouts: bookerLayoutsSchema.parse(
|
||||
eventMetaData?.bookerLayouts ||
|
||||
(userMetaData && "defaultBookerLayouts" in userMetaData ? userMetaData.defaultBookerLayouts : null)
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user