Skip to content

Commit

Permalink
fix: #7448
Browse files Browse the repository at this point in the history
don't set parent to itself
  • Loading branch information
barisusakli committed Mar 13, 2019
1 parent 8029314 commit 4732bed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/categories/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ module.exports = function (Categories) {

const oldParent = parseInt(destination.parentCid, 10) || 0;
const newParent = parseInt(results.source.parentCid, 10) || 0;
if (copyParent) {
if (copyParent && newParent !== parseInt(toCid, 10)) {
tasks.push(async.apply(db.sortedSetRemove, 'cid:' + oldParent + ':children', toCid));
tasks.push(async.apply(db.sortedSetAdd, 'cid:' + newParent + ':children', results.source.order, toCid));
tasks.push(function (next) {
Expand Down

0 comments on commit 4732bed

Please sign in to comment.