mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
remove unnecessary checks
This commit is contained in:
@@ -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]]'));
|
||||
|
||||
Reference in New Issue
Block a user