mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-03 06:10:38 +01:00
closes #3046
This commit is contained in:
@@ -149,8 +149,8 @@ function filterAndSort(pids, data, callback) {
|
||||
}
|
||||
|
||||
function getMatchedPosts(pids, data, callback) {
|
||||
var postFields = ['pid', 'tid', 'timestamp'];
|
||||
var topicFields = [];
|
||||
var postFields = ['pid', 'tid', 'timestamp', 'deleted'];
|
||||
var topicFields = ['deleted'];
|
||||
var categoryFields = [];
|
||||
|
||||
if (data.replies) {
|
||||
@@ -180,7 +180,9 @@ function getMatchedPosts(pids, data, callback) {
|
||||
db.getObjectsFields(keys, postFields, next);
|
||||
},
|
||||
function(_posts, next) {
|
||||
posts = _posts;
|
||||
posts = _posts.filter(function(post) {
|
||||
return post && parseInt(post.deleted, 10) !== 1;
|
||||
});
|
||||
|
||||
async.parallel({
|
||||
users: function(next) {
|
||||
@@ -194,10 +196,6 @@ function getMatchedPosts(pids, data, callback) {
|
||||
}
|
||||
},
|
||||
topics: function(next) {
|
||||
if (!topicFields.length) {
|
||||
return next();
|
||||
}
|
||||
|
||||
var topics;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
@@ -268,6 +266,10 @@ function getMatchedPosts(pids, data, callback) {
|
||||
}
|
||||
});
|
||||
|
||||
posts = posts.filter(function(post) {
|
||||
return post && post.topic && parseInt(post.topic.deleted, 10) !== 1;
|
||||
});
|
||||
|
||||
next(null, posts);
|
||||
}
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user