This commit is contained in:
Barış Soner Uşaklı
2015-09-15 12:58:19 -04:00
parent 4acb31839e
commit 5b08538264
3 changed files with 14 additions and 0 deletions

View File

@@ -333,6 +333,9 @@ var async = require('async'),
privileges.categories.filterCids('find', children, uid, next);
},
function (children, next) {
children = children.filter(function(cid) {
return parseInt(category.cid, 10) !== parseInt(cid, 10);
});
if (!children.length) {
category.children = [];
return callback();