import { z } from "zod" import { removeMultipleSlashes } from "@/utils/url" import { systemSchema } from "../schemas/system" export const destinationOverviewPageSchema = z.object({ destination_overview_page: z.object({ title: z.string(), system: systemSchema.merge( z.object({ created_at: z.string(), updated_at: z.string(), }) ), }), trackingProps: z.object({ url: z.string(), }), }) export const countryPageUrlSchema = z .object({ all_destination_country_page: z.object({ items: z.array( z .object({ url: z.string(), system: systemSchema, }) .transform((data) => { return { url: removeMultipleSlashes(`/${data.system.locale}/${data.url}`), } }) ), }), }) .transform( ({ all_destination_country_page }) => all_destination_country_page.items[0] ) /** REFS */ export const destinationOverviewPageRefsSchema = z.object({ destination_overview_page: z.object({ system: systemSchema, }), })