mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -11,10 +11,10 @@ var helpers = require('./helpers');
|
||||
|
||||
var groupsController = {};
|
||||
|
||||
groupsController.list = function(req, res, next) {
|
||||
groupsController.list = function (req, res, next) {
|
||||
var sort = req.query.sort || 'alpha';
|
||||
|
||||
groupsController.getGroupsFromSet(req.uid, sort, 0, 14, function(err, data) {
|
||||
groupsController.getGroupsFromSet(req.uid, sort, 0, 14, function (err, data) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ groupsController.list = function(req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
groupsController.getGroupsFromSet = function(uid, sort, start, stop, callback) {
|
||||
groupsController.getGroupsFromSet = function (uid, sort, start, stop, callback) {
|
||||
var set = 'groups:visible:name';
|
||||
if (sort === 'count') {
|
||||
set = 'groups:visible:memberCount';
|
||||
@@ -32,7 +32,7 @@ groupsController.getGroupsFromSet = function(uid, sort, start, stop, callback) {
|
||||
set = 'groups:visible:createtime';
|
||||
}
|
||||
|
||||
groups.getGroupsFromSet(set, uid, start, stop, function(err, groups) {
|
||||
groups.getGroupsFromSet(set, uid, start, stop, function (err, groups) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -45,13 +45,13 @@ groupsController.getGroupsFromSet = function(uid, sort, start, stop, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
groupsController.details = function(req, res, callback) {
|
||||
groupsController.details = function (req, res, callback) {
|
||||
var groupName;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
groups.getGroupNameByGroupSlug(req.params.slug, next);
|
||||
},
|
||||
function(_groupName, next) {
|
||||
function (_groupName, next) {
|
||||
groupName = _groupName;
|
||||
if (!groupName) {
|
||||
return callback();
|
||||
@@ -71,7 +71,7 @@ groupsController.details = function(req, res, callback) {
|
||||
async.parallel({
|
||||
isMember: async.apply(groups.isMember, req.uid, groupName),
|
||||
isInvited: async.apply(groups.isInvited, req.uid, groupName)
|
||||
}, function(err, checks) {
|
||||
}, function (err, checks) {
|
||||
if (err || checks.isMember || checks.isInvited) {
|
||||
return next(err);
|
||||
}
|
||||
@@ -80,25 +80,25 @@ groupsController.details = function(req, res, callback) {
|
||||
},
|
||||
function (next) {
|
||||
async.parallel({
|
||||
group: function(next) {
|
||||
group: function (next) {
|
||||
groups.get(groupName, {
|
||||
uid: req.uid,
|
||||
truncateUserList: true,
|
||||
userListCount: 20
|
||||
}, next);
|
||||
},
|
||||
posts: function(next) {
|
||||
posts: function (next) {
|
||||
groups.getLatestMemberPosts(groupName, 10, req.uid, next);
|
||||
},
|
||||
isAdmin:function(next) {
|
||||
isAdmin:function (next) {
|
||||
user.isAdministrator(req.uid, next);
|
||||
},
|
||||
isGlobalMod: function(next) {
|
||||
isGlobalMod: function (next) {
|
||||
user.isGlobalModerator(req.uid, next);
|
||||
}
|
||||
}, next);
|
||||
}
|
||||
], function(err, results) {
|
||||
], function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -115,17 +115,17 @@ groupsController.details = function(req, res, callback) {
|
||||
});
|
||||
};
|
||||
|
||||
groupsController.members = function(req, res, next) {
|
||||
groupsController.members = function (req, res, next) {
|
||||
var groupName;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
groups.getGroupNameByGroupSlug(req.params.slug, next);
|
||||
},
|
||||
function(_groupName, next) {
|
||||
function (_groupName, next) {
|
||||
groupName = _groupName;
|
||||
user.getUsersFromSet('group:' + groupName + ':members', req.uid, 0, 49, next);
|
||||
},
|
||||
], function(err, users) {
|
||||
], function (err, users) {
|
||||
if (err || !groupName) {
|
||||
return next(err);
|
||||
}
|
||||
@@ -145,13 +145,13 @@ groupsController.members = function(req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
groupsController.uploadCover = function(req, res, next) {
|
||||
groupsController.uploadCover = function (req, res, next) {
|
||||
var params = JSON.parse(req.body.params);
|
||||
|
||||
groups.updateCover(req.uid, {
|
||||
file: req.files.files[0].path,
|
||||
groupName: params.groupName
|
||||
}, function(err, image) {
|
||||
}, function (err, image) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user