mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 04:17:03 +02:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -11,9 +11,9 @@ var topics = require('../topics');
|
||||
var categories = require('../categories');
|
||||
|
||||
|
||||
module.exports = function(Posts) {
|
||||
module.exports = function (Posts) {
|
||||
|
||||
Posts.create = function(data, callback) {
|
||||
Posts.create = function (data, callback) {
|
||||
// This is an internal method, consider using Topics.reply instead
|
||||
var uid = data.uid;
|
||||
var tid = data.tid;
|
||||
@@ -27,10 +27,10 @@ module.exports = function(Posts) {
|
||||
var postData;
|
||||
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.incrObjectField('global', 'nextPid', next);
|
||||
},
|
||||
function(pid, next) {
|
||||
function (pid, next) {
|
||||
|
||||
postData = {
|
||||
'pid': pid,
|
||||
@@ -55,23 +55,23 @@ module.exports = function(Posts) {
|
||||
|
||||
plugins.fireHook('filter:post.save', postData, next);
|
||||
},
|
||||
function(postData, next) {
|
||||
function (postData, next) {
|
||||
plugins.fireHook('filter:post.create', {post: postData, data: data}, next);
|
||||
},
|
||||
function(data, next) {
|
||||
function (data, next) {
|
||||
postData = data.post;
|
||||
db.setObject('post:' + postData.pid, postData, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
async.parallel([
|
||||
function(next) {
|
||||
function (next) {
|
||||
user.onNewPostMade(postData, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
topics.onNewPostMade(postData, next);
|
||||
},
|
||||
function(next) {
|
||||
topics.getTopicFields(tid, ['cid', 'pinned'], function(err, topicData) {
|
||||
function (next) {
|
||||
topics.getTopicFields(tid, ['cid', 'pinned'], function (err, topicData) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
@@ -79,20 +79,20 @@ module.exports = function(Posts) {
|
||||
categories.onNewPostMade(topicData.cid, topicData.pinned, postData, next);
|
||||
});
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetAdd('posts:pid', timestamp, postData.pid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.incrObjectField('global', 'postCount', next);
|
||||
}
|
||||
], function(err) {
|
||||
], function (err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
plugins.fireHook('filter:post.get', postData, next);
|
||||
});
|
||||
},
|
||||
function(postData, next) {
|
||||
function (postData, next) {
|
||||
plugins.fireHook('action:post.save', _.clone(postData));
|
||||
next(null, postData);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user