mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -6,46 +6,46 @@ var async = require('async');
|
||||
var topics = require('../topics');
|
||||
var utils = require('../../public/src/utils');
|
||||
|
||||
module.exports = function(Posts) {
|
||||
module.exports = function (Posts) {
|
||||
|
||||
Posts.getPostsFromSet = function(set, start, stop, uid, reverse, callback) {
|
||||
Posts.getPostsFromSet = function (set, start, stop, uid, reverse, callback) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
Posts.getPidsFromSet(set, start, stop, reverse, next);
|
||||
},
|
||||
function(pids, next) {
|
||||
function (pids, next) {
|
||||
Posts.getPostsByPids(pids, uid, next);
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Posts.isMain = function(pid, callback) {
|
||||
Posts.isMain = function (pid, callback) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
Posts.getPostField(pid, 'tid', next);
|
||||
},
|
||||
function(tid, next) {
|
||||
function (tid, next) {
|
||||
topics.getTopicField(tid, 'mainPid', next);
|
||||
},
|
||||
function(mainPid, next) {
|
||||
function (mainPid, next) {
|
||||
next(null, parseInt(pid, 10) === parseInt(mainPid, 10));
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Posts.getTopicFields = function(pid, fields, callback) {
|
||||
Posts.getTopicFields = function (pid, fields, callback) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
Posts.getPostField(pid, 'tid', next);
|
||||
},
|
||||
function(tid, next) {
|
||||
function (tid, next) {
|
||||
topics.getTopicFields(tid, fields, next);
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
Posts.generatePostPath = function (pid, uid, callback) {
|
||||
Posts.generatePostPaths([pid], uid, function(err, paths) {
|
||||
Posts.generatePostPaths([pid], uid, function (err, paths) {
|
||||
callback(err, Array.isArray(paths) && paths.length ? paths[0] : null);
|
||||
});
|
||||
};
|
||||
@@ -57,11 +57,11 @@ module.exports = function(Posts) {
|
||||
},
|
||||
function (postData, next) {
|
||||
async.parallel({
|
||||
indices: function(next) {
|
||||
indices: function (next) {
|
||||
Posts.getPostIndices(postData, uid, next);
|
||||
},
|
||||
topics: function(next) {
|
||||
var tids = postData.map(function(post) {
|
||||
topics: function (next) {
|
||||
var tids = postData.map(function (post) {
|
||||
return post ? post.tid : null;
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ module.exports = function(Posts) {
|
||||
}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
var paths = pids.map(function(pid, index) {
|
||||
var paths = pids.map(function (pid, index) {
|
||||
var slug = results.topics[index] ? results.topics[index].slug : null;
|
||||
var postIndex = utils.isNumber(results.indices[index]) ? parseInt(results.indices[index], 10) + 1 : null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user