fix(medusa): fix rank order changing on category update (#3486)
what: - fixes issue where ranking changes when only properties other than rank are updated on categories FIXES CORE-1253
This commit is contained in:
@@ -310,7 +310,9 @@ class ProductCategoryService extends TransactionBaseService {
|
||||
const targetRank = input.rank
|
||||
const shouldChangeParent =
|
||||
targetParentId !== undefined && targetParentId !== originalParentId
|
||||
const shouldChangeRank = shouldChangeParent || originalRank !== targetRank
|
||||
const shouldChangeRank =
|
||||
shouldChangeParent ||
|
||||
(isDefined(targetRank) && originalRank !== targetRank)
|
||||
|
||||
return {
|
||||
targetCategoryId: productCategory.id,
|
||||
|
||||
Reference in New Issue
Block a user