fix(utils): totals calculation (#8190)

This commit is contained in:
Carlos R. L. Rodrigues
2024-07-19 06:49:49 -03:00
committed by GitHub
parent fe5a7b1810
commit 07205e4249
17 changed files with 131 additions and 137 deletions

View File

@@ -2,7 +2,6 @@ import { BigNumberInput, OrderSummaryDTO } from "@medusajs/types"
import {
BigNumber,
MathBN,
isDefined,
isPresent,
transformPropertiesToBigNumber,
} from "@medusajs/utils"
@@ -195,7 +194,7 @@ export class OrderChangeProcessing {
calculatedAmount = type.operation(params) as BigNumberInput
// the action.amount has priority over the calculated amount
if (!isDefined(action.amount)) {
if (action.amount == undefined) {
action.amount = calculatedAmount ?? 0
}
}