mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -8,9 +8,9 @@ var topics = require('../topics');
|
||||
var user = require('../user');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
module.exports = function(Posts) {
|
||||
module.exports = function (Posts) {
|
||||
|
||||
Posts.delete = function(pid, uid, callback) {
|
||||
Posts.delete = function (pid, uid, callback) {
|
||||
var postData;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
@@ -28,13 +28,13 @@ module.exports = function(Posts) {
|
||||
},
|
||||
function (topicData, next) {
|
||||
async.parallel([
|
||||
function(next) {
|
||||
function (next) {
|
||||
updateTopicTimestamp(topicData, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetRemove('cid:' + topicData.cid + ':pids', pid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
topics.updateTeaser(postData.tid, next);
|
||||
}
|
||||
], next);
|
||||
@@ -46,7 +46,7 @@ module.exports = function(Posts) {
|
||||
], callback);
|
||||
};
|
||||
|
||||
Posts.restore = function(pid, uid, callback) {
|
||||
Posts.restore = function (pid, uid, callback) {
|
||||
var postData;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
@@ -65,13 +65,13 @@ module.exports = function(Posts) {
|
||||
function (topicData, next) {
|
||||
postData.cid = topicData.cid;
|
||||
async.parallel([
|
||||
function(next) {
|
||||
function (next) {
|
||||
updateTopicTimestamp(topicData, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetAdd('cid:' + topicData.cid + ':pids', postData.timestamp, pid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
topics.updateTeaser(postData.tid, next);
|
||||
}
|
||||
], next);
|
||||
@@ -112,7 +112,7 @@ module.exports = function(Posts) {
|
||||
], callback);
|
||||
}
|
||||
|
||||
Posts.purge = function(pid, uid, callback) {
|
||||
Posts.purge = function (pid, uid, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
Posts.exists(pid, next);
|
||||
@@ -143,7 +143,7 @@ module.exports = function(Posts) {
|
||||
function (next) {
|
||||
Posts.dismissFlag(pid, next);
|
||||
}
|
||||
], function(err) {
|
||||
], function (err) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ module.exports = function(Posts) {
|
||||
};
|
||||
|
||||
function deletePostFromTopicAndUser(pid, callback) {
|
||||
Posts.getPostFields(pid, ['tid', 'uid'], function(err, postData) {
|
||||
Posts.getPostFields(pid, ['tid', 'uid'], function (err, postData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -164,12 +164,12 @@ module.exports = function(Posts) {
|
||||
'tid:' + postData.tid + ':posts',
|
||||
'tid:' + postData.tid + ':posts:votes',
|
||||
'uid:' + postData.uid + ':posts'
|
||||
], pid, function(err) {
|
||||
], pid, function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
topics.getTopicFields(postData.tid, ['tid', 'cid', 'pinned'], function(err, topicData) {
|
||||
topics.getTopicFields(postData.tid, ['tid', 'cid', 'pinned'], function (err, topicData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -184,19 +184,19 @@ module.exports = function(Posts) {
|
||||
function (next) {
|
||||
topics.decreasePostCount(postData.tid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
topics.updateTeaser(postData.tid, next);
|
||||
},
|
||||
function (next) {
|
||||
updateTopicTimestamp(topicData, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetIncrBy('cid:' + topicData.cid + ':tids:posts', -1, postData.tid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetIncrBy('tid:' + postData.tid + ':posters', -1, postData.uid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
user.incrementUserPostCountBy(postData.uid, -1, next);
|
||||
}
|
||||
], callback);
|
||||
@@ -206,12 +206,12 @@ module.exports = function(Posts) {
|
||||
}
|
||||
|
||||
function deletePostFromCategoryRecentPosts(pid, callback) {
|
||||
db.getSortedSetRange('categories:cid', 0, -1, function(err, cids) {
|
||||
db.getSortedSetRange('categories:cid', 0, -1, function (err, cids) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var sets = cids.map(function(cid) {
|
||||
var sets = cids.map(function (cid) {
|
||||
return 'cid:' + cid + ':pids';
|
||||
});
|
||||
|
||||
@@ -220,16 +220,16 @@ module.exports = function(Posts) {
|
||||
}
|
||||
|
||||
function deletePostFromUsersBookmarks(pid, callback) {
|
||||
db.getSetMembers('pid:' + pid + ':users_bookmarked', function(err, uids) {
|
||||
db.getSetMembers('pid:' + pid + ':users_bookmarked', function (err, uids) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var sets = uids.map(function(uid) {
|
||||
var sets = uids.map(function (uid) {
|
||||
return 'uid:' + uid + ':bookmarks';
|
||||
});
|
||||
|
||||
db.sortedSetsRemove(sets, pid, function(err) {
|
||||
db.sortedSetsRemove(sets, pid, function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -241,33 +241,33 @@ module.exports = function(Posts) {
|
||||
|
||||
function deletePostFromUsersVotes(pid, callback) {
|
||||
async.parallel({
|
||||
upvoters: function(next) {
|
||||
upvoters: function (next) {
|
||||
db.getSetMembers('pid:' + pid + ':upvote', next);
|
||||
},
|
||||
downvoters: function(next) {
|
||||
downvoters: function (next) {
|
||||
db.getSetMembers('pid:' + pid + ':downvote', next);
|
||||
}
|
||||
}, function(err, results) {
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var upvoterSets = results.upvoters.map(function(uid) {
|
||||
var upvoterSets = results.upvoters.map(function (uid) {
|
||||
return 'uid:' + uid + ':upvote';
|
||||
});
|
||||
|
||||
var downvoterSets = results.downvoters.map(function(uid) {
|
||||
var downvoterSets = results.downvoters.map(function (uid) {
|
||||
return 'uid:' + uid + ':downvote';
|
||||
});
|
||||
|
||||
async.parallel([
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetsRemove(upvoterSets, pid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetsRemove(downvoterSets, pid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.deleteAll(['pid:' + pid + ':upvote', 'pid:' + pid + ':downvote'], next);
|
||||
}
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user