fix(medusa): Post /admin/discounts/:id not updating condition operator (#1573)
This commit is contained in:
1 parent
a33c1cfb14
commit
5414148254
2 files changed
+11
-3
No files matched your search
@@ -122,6 +122,13 @@ class DiscountConditionService extends BaseService {
|
||||
manager.getCustomRepository(this.discountConditionRepository_)
|
||||
|
||||
if (data.id) {
|
||||
const resolvedCondition = await this.retrieve(data.id)
|
||||
|
||||
if (data.operator && data.operator !== resolvedCondition.operator) {
|
||||
resolvedCondition.operator = data.operator
|
||||
await discountConditionRepo.save(resolvedCondition)
|
||||
}
|
||||
|
||||
return await discountConditionRepo.addConditionResources(
|
||||
data.id,
|
||||
resolvedConditionType.resource_ids,
|
||||
|
||||
Reference in new issue
Block a user