Fix: Added optional merchantInformationData
This commit is contained in:
@@ -216,10 +216,11 @@ 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.cards
|
hotelData.data.attributes.merchantInformationData
|
||||||
|
?.cards ?? []
|
||||||
}
|
}
|
||||||
mustBeGuaranteed={mustBeGuaranteed}
|
mustBeGuaranteed={mustBeGuaranteed}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -470,11 +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.default({
|
merchantInformationData: merchantInformationSchema.optional(),
|
||||||
webMerchantId: "",
|
|
||||||
cards: {},
|
|
||||||
alternatePaymentOptions: {},
|
|
||||||
}),
|
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
operaId: z.string(),
|
operaId: z.string(),
|
||||||
parking: z.array(parkingSchema),
|
parking: z.array(parkingSchema),
|
||||||
|
|||||||
@@ -193,8 +193,12 @@ export const getHotelData = cache(
|
|||||||
const hotelData = validateHotelData.data
|
const hotelData = validateHotelData.data
|
||||||
|
|
||||||
if (isCardOnlyPayment) {
|
if (isCardOnlyPayment) {
|
||||||
hotelData.data.attributes.merchantInformationData.alternatePaymentOptions =
|
const currentData = hotelData.data.attributes.merchantInformationData
|
||||||
[]
|
hotelData.data.attributes.merchantInformationData = {
|
||||||
|
webMerchantId: currentData?.webMerchantId ?? "",
|
||||||
|
cards: currentData?.cards ?? [],
|
||||||
|
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
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { PaymentMethodEnum } from "@/constants/booking"
|
import type { CreditCard, SafeUser } from "@/types/user"
|
||||||
|
import type { PaymentMethodEnum } from "@/constants/booking"
|
||||||
import { CreditCard, SafeUser } from "@/types/user"
|
|
||||||
|
|
||||||
export interface SectionProps {
|
export interface SectionProps {
|
||||||
nextPath: string
|
nextPath: string
|
||||||
|
|||||||
Reference in New Issue
Block a user