Fix space-before-function-paren linter rule

This commit is contained in:
HeeL
2016-10-13 11:43:39 +02:00
parent 3fa1c1f927
commit 4a3c31b2dc
385 changed files with 6621 additions and 6622 deletions

View File

@@ -12,17 +12,17 @@ var async = require('async'),
var groupsController = {};
groupsController.list = function(req, res, next) {
groupsController.list = function (req, res, next) {
var page = parseInt(req.query.page, 10) || 1;
var groupsPerPage = 20;
var pageCount = 0;
async.waterfall([
function(next) {
function (next) {
db.getSortedSetRevRange('groups:createtime', 0, -1, next);
},
function(groupNames, next) {
groupNames = groupNames.filter(function(name) {
function (groupNames, next) {
groupNames = groupNames.filter(function (name) {
return name.indexOf(':privileges:') === -1 && name !== 'registered-users';
});
pageCount = Math.ceil(groupNames.length / groupsPerPage);
@@ -33,10 +33,10 @@ groupsController.list = function(req, res, next) {
groupNames = groupNames.slice(start, stop + 1);
groups.getGroupsData(groupNames, next);
},
function(groupData, next) {
function (groupData, next) {
next(null, {groups: groupData, pagination: pagination.create(page, pageCount)});
}
], function(err, data) {
], function (err, data) {
if (err) {
return next(err);
}
@@ -49,19 +49,19 @@ groupsController.list = function(req, res, next) {
});
};
groupsController.get = function(req, res, callback) {
groupsController.get = function (req, res, callback) {
var groupName = req.params.name;
async.waterfall([
function(next){
function (next){
groups.exists(groupName, next);
},
function(exists, next) {
function (exists, next) {
if (!exists) {
return callback();
}
groups.get(groupName, {uid: req.uid, truncateUserList: true, userListCount: 20}, next);
}
], function(err, group) {
], function (err, group) {
if (err) {
return callback(err);
}