remove unnecessary checks

This commit is contained in:
Barış Soner Uşaklı
2017-05-27 00:30:07 -04:00
parent 6a742ead38
commit f1b8492164
12 changed files with 29 additions and 40 deletions

View File

@@ -94,10 +94,6 @@ Categories.getAllCategories = function (uid, callback) {
db.getSortedSetRange('categories:cid', 0, -1, next);
},
function (cids, next) {
if (!Array.isArray(cids) || !cids.length) {
return next(null, []);
}
Categories.getCategories(cids, uid, next);
},
], callback);
@@ -123,16 +119,11 @@ Categories.getModerators = function (cid, callback) {
Groups.getMembers('cid:' + cid + ':privileges:moderate', 0, -1, next);
},
function (uids, next) {
if (!Array.isArray(uids) || !uids.length) {
return next(null, []);
}
user.getUsersFields(uids, ['uid', 'username', 'userslug', 'picture'], next);
},
], callback);
};
Categories.getCategories = function (cids, uid, callback) {
if (!Array.isArray(cids)) {
return callback(new Error('[[error:invalid-cid]]'));