if a parent category is deleted add its children to root

v1.18.x
barisusakli 10 years ago
parent 32041d50f7
commit f9c8b1acf8

@ -65,7 +65,14 @@ module.exports = function(Categories) {
},
function(next) {
async.each(results.children, function(cid, next) {
db.setObjectField('category:' + cid, 'parentCid', 0, next);
async.parallel([
function(next) {
db.setObjectField('category:' + cid, 'parentCid', 0, next);
},
function(next) {
db.sortedSetAdd('cid:0:children', cid, cid, next);
}
], next);
}, next);
}
], next);

Loading…
Cancel
Save