load category parents and childrens in one call

add more missing guest/spider checks
This commit is contained in:
Barış Soner Uşaklı
2018-11-22 10:53:44 -05:00
parent a6864a8055
commit eba1a405d2
4 changed files with 55 additions and 27 deletions

View File

@@ -13,7 +13,7 @@ const intFields = [
module.exports = function (Categories) {
Categories.getCategoriesFields = function (cids, fields, callback) {
if (!Array.isArray(cids) || !cids.length) {
return callback(null, []);
return setImmediate(callback, null, []);
}
var keys = cids.map(cid => 'category:' + cid);