diff --git a/server/routers/contentstack/hotelPage/output.ts b/server/routers/contentstack/hotelPage/output.ts index c6fed0fc7..d82ec0ac3 100644 --- a/server/routers/contentstack/hotelPage/output.ts +++ b/server/routers/contentstack/hotelPage/output.ts @@ -26,22 +26,23 @@ export const activityCardSchema = z.object({ }), }) +const contentBlockActivity = z.object({ + __typename: z.literal( + HotelBlocksTypenameEnum.HotelPageContentUpcomingActivitiesCard + ), + upcoming_activities_card: activityCardSchema.optional(), +}) + +const contentBlockItem = z.discriminatedUnion("__typename", [ + contentBlockActivity, +]) + export const validateHotelPageSchema = z.object({ hotel_page: z.object({ hotel_page_id: z.string(), title: z.string(), url: z.string(), - content: z - .array( - z.object({ - __typename: z.literal( - HotelBlocksTypenameEnum.HotelPageContentUpcomingActivitiesCard - ), - upcoming_activities_card: activityCardSchema.optional(), - }) - ) - .nullable() - .optional(), + content: z.array(contentBlockItem).nullable(), }), }) diff --git a/server/routers/hotels/query.ts b/server/routers/hotels/query.ts index 50d4d0507..755644dfb 100644 --- a/server/routers/hotels/query.ts +++ b/server/routers/hotels/query.ts @@ -56,7 +56,7 @@ const availabilityFailCounter = meter.createCounter( "trpc.hotel.availability-fail" ) -async function getContenstackData( +async function getContentstackData( locale: string, uid: string | null | undefined ) { @@ -90,7 +90,7 @@ export const hotelQueryRouter = router({ .query(async ({ ctx, input }) => { const { lang, uid } = ctx const { include } = input - const contentstackData = await getContenstackData(lang, uid) + const contentstackData = await getContentstackData(lang, uid) const hotelId = contentstackData?.hotel_page_id if (!hotelId) { diff --git a/utils/cardTheme.ts b/utils/cardTheme.ts index 6e8bfb700..f49b7c677 100644 --- a/utils/cardTheme.ts +++ b/utils/cardTheme.ts @@ -39,9 +39,6 @@ export function getTheme(theme: CardProps["theme"]) { secondaryLinkColor = "burgundy" break case "primaryStrong": - buttonTheme = "primaryStrong" - primaryLinkColor = "red" - secondaryLinkColor = "white" case "image": buttonTheme = "primaryStrong" primaryLinkColor = "red"