Revert "chore(SW-303): fetch activity card from CS"
This reverts commit dde9ca190a.
This commit is contained in:
@@ -1,50 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { HotelBlocksTypenameEnum } from "@/types/components/hotelPage/enums"
|
||||
|
||||
export const activityCardSchema = z.object({
|
||||
background_image: z.any(),
|
||||
cta_text: z.string(),
|
||||
heading: z.string(),
|
||||
open_in_new_tab: z.boolean(),
|
||||
scripted_title: z.string().optional(),
|
||||
body_text: z.string(),
|
||||
hotel_page_activities_content_pageConnection: z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
node: z.object({
|
||||
url: z.string(),
|
||||
web: z.object({
|
||||
original_url: z.string().optional(),
|
||||
}),
|
||||
system: z.object({
|
||||
locale: z.string(),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
),
|
||||
}),
|
||||
})
|
||||
|
||||
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(),
|
||||
})
|
||||
)
|
||||
.optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const hotelPageSchema = z.object({
|
||||
hotel_page: z.object({
|
||||
hotel_page_id: z.string(),
|
||||
title: z.string(),
|
||||
@@ -56,6 +12,5 @@ export const hotelPageSchema = z.object({
|
||||
export type HotelPageDataRaw = z.infer<typeof validateHotelPageSchema>
|
||||
|
||||
type HotelPageRaw = HotelPageDataRaw["hotel_page"]
|
||||
export type HotelPage = HotelPageRaw
|
||||
|
||||
export type ActivityCard = z.infer<typeof activityCardSchema>
|
||||
export type HotelPage = HotelPageRaw
|
||||
|
||||
Reference in New Issue
Block a user