Fix not in promotion rule empty value validation (#14172)

This commit is contained in:
Pepijn
2025-12-01 15:04:57 +01:00
committed by GitHub
parent ee1be833c3
commit 6bc5bf4fc9
3 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/promotion": patch
---
Fix not in promotion rule empty value validation

View File

@@ -35,6 +35,7 @@ moduleIntegrationTestRunner({
expect(testFunc(["2"], operator, [2])).toEqual(false)
expect(testFunc(["2"], operator, ["2"])).toEqual(false)
expect(testFunc(["2"], operator, ["22"])).toEqual(true)
expect(testFunc(["2"], operator, [])).toEqual(true)
})
})

View File

@@ -118,7 +118,12 @@ export function evaluateRuleValueCondition(
: [ruleValuesToCheck]
if (!valuesToCheck.length) {
return false
switch (operator) {
case "ne":
return true
default:
return false
}
}
switch (operator) {