fix: widen range of discount limit conditions (#895)
This commit is contained in:
@@ -1047,7 +1047,7 @@ class CartService extends BaseService {
|
|||||||
if (discount.usage_limit) {
|
if (discount.usage_limit) {
|
||||||
discount.usage_count = discount.usage_count || 0
|
discount.usage_count = discount.usage_count || 0
|
||||||
|
|
||||||
if (discount.usage_limit === discount.usage_count) {
|
if (discount.usage_count >= discount.usage_limit) {
|
||||||
throw new MedusaError(
|
throw new MedusaError(
|
||||||
MedusaError.Types.NOT_ALLOWED,
|
MedusaError.Types.NOT_ALLOWED,
|
||||||
"Discount has been used maximum allowed times"
|
"Discount has been used maximum allowed times"
|
||||||
|
|||||||
Reference in New Issue
Block a user