make 1 call for parentCids

This commit is contained in:
Barış Soner Uşaklı
2018-11-22 18:21:43 -05:00
parent dc670a7bb5
commit d5af39ca5d
2 changed files with 16 additions and 15 deletions

View File

@@ -16,10 +16,9 @@ module.exports = function (Categories) {
return setImmediate(callback, null, []);
}
var keys = cids.map(cid => 'category:' + cid);
async.waterfall([
function (next) {
const keys = cids.map(cid => 'category:' + cid);
if (fields.length) {
db.getObjectsFields(keys, fields, next);
} else {