mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
moved increase/decrease
moved these two methods into addPostToTopic&removePostFromTopic
This commit is contained in:
@@ -15,9 +15,6 @@ var utils = require('../../public/src/utils');
|
||||
module.exports = function (Topics) {
|
||||
Topics.onNewPostMade = function (postData, callback) {
|
||||
async.series([
|
||||
function (next) {
|
||||
Topics.increasePostCount(postData.tid, next);
|
||||
},
|
||||
function (next) {
|
||||
Topics.updateLastPostTime(postData.tid, postData.timestamp, next);
|
||||
},
|
||||
@@ -287,6 +284,9 @@ module.exports = function (Topics) {
|
||||
});
|
||||
}
|
||||
},
|
||||
function (next) {
|
||||
Topics.increasePostCount(tid, next);
|
||||
},
|
||||
function (next) {
|
||||
db.sortedSetIncrBy('tid:' + tid + ':posters', 1, postData.uid, next);
|
||||
},
|
||||
@@ -304,6 +304,9 @@ module.exports = function (Topics) {
|
||||
'tid:' + tid + ':posts:votes',
|
||||
], postData.pid, next);
|
||||
},
|
||||
function (next) {
|
||||
Topics.decreasePostCount(tid, next);
|
||||
},
|
||||
function (next) {
|
||||
db.sortedSetIncrBy('tid:' + tid + ':posters', -1, postData.uid, next);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user