Free shipping

This commit is contained in:
Sebastian Rindom
2020-07-06 21:45:02 +02:00
parent ca6dd7e257
commit 8c5fa44e5f

View File

@@ -252,10 +252,13 @@ class ShippingOptionService extends BaseService {
}
}
if (price.type === "flat_rate" && (!price.amount || price.amount <= 0)) {
if (
price.type === "flat_rate" &&
(price.amount === undefined || price.amount < 0)
) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
"Flat rate prices must have be zero or have a postive amount field."
"Flat rate prices must be zero or have a postive amount field."
)
}