fix(SW-188): remove refine and validate on transform for hotel schema
This commit is contained in:
@@ -421,18 +421,13 @@ export const getHotelDataSchema = z.object({
|
||||
data: z.object({
|
||||
id: z.string(),
|
||||
type: z.string(), // No enum here but the standard return appears to be "hotels".
|
||||
language: z
|
||||
.string()
|
||||
.refine((val) => toLang(val) !== undefined, {
|
||||
message: "Invalid language",
|
||||
})
|
||||
.transform((val) => {
|
||||
const lang = toLang(val)
|
||||
if (!lang) {
|
||||
throw new Error("Invalid language")
|
||||
}
|
||||
return lang
|
||||
}),
|
||||
language: z.string().transform((val) => {
|
||||
const lang = toLang(val)
|
||||
if (!lang) {
|
||||
throw new Error("Invalid language")
|
||||
}
|
||||
return lang
|
||||
}),
|
||||
attributes: z.object({
|
||||
name: z.string(),
|
||||
operaId: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user