mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-04 11:57:44 +02:00
teaser fixes
if a post is deleted/restored update the teaser to the latest undeleted pid, if all posts are deleted it will be set to null
This commit is contained in:
@@ -33,6 +33,9 @@ module.exports = function(Posts) {
|
||||
},
|
||||
function(next) {
|
||||
Posts.dismissFlag(pid, next);
|
||||
},
|
||||
function(next) {
|
||||
topics.updateTeaser(postData.tid, next);
|
||||
}
|
||||
], function(err) {
|
||||
callback(err, postData);
|
||||
@@ -64,6 +67,9 @@ module.exports = function(Posts) {
|
||||
},
|
||||
function(next) {
|
||||
db.sortedSetAdd('cid:' + cid + ':pids', postData.timestamp, pid, next);
|
||||
},
|
||||
function(next) {
|
||||
topics.updateTeaser(postData.tid, next);
|
||||
}
|
||||
], function(err) {
|
||||
callback(err, postData);
|
||||
|
||||
Reference in New Issue
Block a user