fix: rename children to childrenInRoom
This commit is contained in:
@@ -11,7 +11,7 @@ export default function BedTypeInfo({ hasMultipleBedTypes }: BedTypeInfoProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
const hasChildWithExtraBed = useEnterDetailsStore((state) =>
|
||||
state.booking.rooms[0].children?.some(
|
||||
state.booking.rooms[0].childrenInRoom?.some(
|
||||
(child) => Number(child.bed) === ChildBedMapEnum.IN_EXTRA_BED
|
||||
)
|
||||
)
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function Breakfast({ packages }: BreakfastProps) {
|
||||
)
|
||||
|
||||
const children = useEnterDetailsStore(
|
||||
(state) => state.booking.rooms[0].children
|
||||
(state) => state.booking.rooms[0].childrenInRoom
|
||||
)
|
||||
|
||||
const methods = useForm<BreakfastFormSchema>({
|
||||
|
||||
@@ -239,7 +239,7 @@ export default function PaymentClient({
|
||||
checkOutDate: toDate,
|
||||
rooms: rooms.map((room) => ({
|
||||
adults: room.adults,
|
||||
childrenAges: room.children?.map((child) => ({
|
||||
childrenAges: room.childrenInRoom?.map((child) => ({
|
||||
age: child.age,
|
||||
bedType: bedTypeMap[parseInt(child.bed.toString())],
|
||||
})),
|
||||
|
||||
@@ -66,7 +66,7 @@ export default function PriceDetailsTable({
|
||||
useEnterDetailsStore(storeSelector)
|
||||
|
||||
// TODO: Update for Multiroom later
|
||||
const { adults, children } = booking.rooms[0]
|
||||
const { adults, childrenInRoom } = booking.rooms[0]
|
||||
const nights = getNights(booking.fromDate, booking.toDate)
|
||||
|
||||
const vatPercentage = vat / 100
|
||||
@@ -121,13 +121,13 @@ export default function PriceDetailsTable({
|
||||
breakfast.localPrice.currency
|
||||
)}
|
||||
/>
|
||||
{children?.length ? (
|
||||
{childrenInRoom?.length ? (
|
||||
<Row
|
||||
label={`${intl.formatMessage(
|
||||
{
|
||||
id: "{totalChildren, plural, one {# child} other {# children}}",
|
||||
},
|
||||
{ totalChildren: children.length }
|
||||
{ totalChildren: childrenInRoom.length }
|
||||
)}, ${intl.formatMessage(
|
||||
{
|
||||
id: "{totalBreakfasts, plural, one {# breakfast} other {# breakfasts}}",
|
||||
|
||||
@@ -73,7 +73,7 @@ export default function SummaryUI({
|
||||
|
||||
// TODO: Update for Multiroom later
|
||||
const adults = booking.rooms[0].adults
|
||||
const children = booking.rooms[0].children
|
||||
const children = booking.rooms[0].childrenInRoom
|
||||
|
||||
const childrenBeds = children?.reduce(
|
||||
(acc, value) => {
|
||||
|
||||
Reference in New Issue
Block a user