fix: Price types has changed to doubles in the API
This commit is contained in:
committed by
Michael Zetterberg
parent
8f9e268802
commit
6fb71dea1b
@@ -205,10 +205,10 @@ export function calcTotalPrice(
|
||||
}
|
||||
|
||||
const breakfastRequestedPrice = room.breakfast
|
||||
? parseInt(room.breakfast.requestedPrice?.price ?? 0)
|
||||
? (room.breakfast.requestedPrice?.price ?? 0)
|
||||
: 0
|
||||
const breakfastLocalPrice = room.breakfast
|
||||
? parseInt(room.breakfast.localPrice?.price ?? 0)
|
||||
? (room.breakfast.localPrice?.price ?? 0)
|
||||
: 0
|
||||
|
||||
const roomFeaturesTotal = room.roomFeatures?.reduce(
|
||||
|
||||
@@ -279,13 +279,11 @@ export function createDetailsStore(
|
||||
|
||||
if (addToTotalPrice) {
|
||||
const breakfastTotalRequestedPrice =
|
||||
parseInt(breakfast.requestedPrice.price) *
|
||||
breakfast.requestedPrice.price *
|
||||
currentRoom.room.adults *
|
||||
nights
|
||||
const breakfastTotalPrice =
|
||||
parseInt(breakfast.localPrice.price) *
|
||||
currentRoom.room.adults *
|
||||
nights
|
||||
breakfast.localPrice.price * currentRoom.room.adults * nights
|
||||
state.totalPrice = {
|
||||
requested: state.totalPrice.requested && {
|
||||
currency: state.totalPrice.requested.currency,
|
||||
@@ -308,13 +306,11 @@ export function createDetailsStore(
|
||||
let currentBreakfastTotalRequestedPrice = 0
|
||||
if (currentRoom.room.breakfast) {
|
||||
currentBreakfastTotalPrice =
|
||||
parseInt(currentRoom.room.breakfast.localPrice.price) *
|
||||
currentRoom.room.breakfast.localPrice.price *
|
||||
currentRoom.room.adults *
|
||||
nights
|
||||
currentBreakfastTotalRequestedPrice =
|
||||
parseInt(
|
||||
currentRoom.room.breakfast.requestedPrice.totalPrice
|
||||
) *
|
||||
currentRoom.room.breakfast.requestedPrice.totalPrice *
|
||||
currentRoom.room.adults *
|
||||
nights
|
||||
currency = currentRoom.room.breakfast.localPrice.currency
|
||||
|
||||
Reference in New Issue
Block a user