mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-08 16:42:48 +01:00
purge topic if it's the post is purged in that topic
This commit is contained in:
@@ -49,6 +49,15 @@ module.exports = function(Posts) {
|
||||
},
|
||||
function(next) {
|
||||
db.sortedSetRemove('uid:' + postData.uid + ':posts', pid, next);
|
||||
},
|
||||
function(next) {
|
||||
db.setCount('tid:' + postData.tid + ':posts', function(err, count) {
|
||||
if (count === 0) {
|
||||
topics.purge(postData.tid, next);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
}
|
||||
], function(err) {
|
||||
if (err) {
|
||||
|
||||
Reference in New Issue
Block a user