Reveret merchantInformationData fix

This commit is contained in:
Pontus Dreij
2024-12-13 14:36:13 +01:00
parent be33837b55
commit 07a7dc9366
3 changed files with 5 additions and 8 deletions

View File

@@ -216,11 +216,10 @@ export default async function StepPage({
roomPrice={roomPrice} roomPrice={roomPrice}
otherPaymentOptions={ otherPaymentOptions={
hotelData.data.attributes.merchantInformationData hotelData.data.attributes.merchantInformationData
?.alternatePaymentOptions ?? [] .alternatePaymentOptions
} }
supportedCards={ supportedCards={
hotelData.data.attributes.merchantInformationData hotelData.data.attributes.merchantInformationData.cards
?.cards ?? []
} }
mustBeGuaranteed={mustBeGuaranteed} mustBeGuaranteed={mustBeGuaranteed}
/> />

View File

@@ -470,7 +470,7 @@ export const hotelAttributesSchema = z.object({
isPublished: z.boolean(), isPublished: z.boolean(),
keywords: z.array(z.string()), keywords: z.array(z.string()),
location: locationSchema, location: locationSchema,
merchantInformationData: merchantInformationSchema.optional(), merchantInformationData: merchantInformationSchema,
name: z.string(), name: z.string(),
operaId: z.string(), operaId: z.string(),
parking: z.array(parkingSchema), parking: z.array(parkingSchema),

View File

@@ -193,10 +193,8 @@ export const getHotelData = cache(
const hotelData = validateHotelData.data const hotelData = validateHotelData.data
if (isCardOnlyPayment) { if (isCardOnlyPayment) {
if (hotelData.data.attributes.merchantInformationData) { hotelData.data.attributes.merchantInformationData.alternatePaymentOptions =
hotelData.data.attributes.merchantInformationData.alternatePaymentOptions = []
[]
}
} }
if (hotelData.data.attributes.gallery) { if (hotelData.data.attributes.gallery) {
const smallerImages = hotelData.data.attributes.gallery.smallerImages const smallerImages = hotelData.data.attributes.gallery.smallerImages