removed extra param

v1.18.x
barisusakli 10 years ago
parent aec4ee5392
commit 878690e5f7

@ -316,7 +316,7 @@ var async = require('async'),
}); });
async.each(categories, function(category, next) { async.each(categories, function(category, next) {
getChildrenRecursive(category, category.cid, uid, next); getChildrenRecursive(category, uid, next);
}, function (err) { }, function (err) {
callback(err, categories.map(function(c) { callback(err, categories.map(function(c) {
return c && c.children; return c && c.children;
@ -324,10 +324,10 @@ var async = require('async'),
}); });
}; };
function getChildrenRecursive(category, parentCid, uid, callback) { function getChildrenRecursive(category, uid, callback) {
async.waterfall([ async.waterfall([
function (next) { function (next) {
db.getSortedSetRange('cid:' + parentCid + ':children', 0, -1, next); db.getSortedSetRange('cid:' + category.cid + ':children', 0, -1, next);
}, },
function (children, next) { function (children, next) {
privileges.categories.filterCids('find', children, uid, next); privileges.categories.filterCids('find', children, uid, next);
@ -342,7 +342,7 @@ var async = require('async'),
function (childrenData, next) { function (childrenData, next) {
category.children = childrenData; category.children = childrenData;
async.each(category.children, function(child, next) { async.each(category.children, function(child, next) {
getChildrenRecursive(child, child.cid, uid, next); getChildrenRecursive(child, uid, next);
}, next); }, next);
} }
], callback); ], callback);
@ -362,7 +362,7 @@ var async = require('async'),
Categories.flattenCategories(allCategories, category.children); Categories.flattenCategories(allCategories, category.children);
} }
}); });
} };
/** /**
* Recursively build tree * Recursively build tree

Loading…
Cancel
Save