mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
if a parent category is deleted add its children to root
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user