mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
reverted main post change, breaks indices
This commit is contained in:
@@ -256,24 +256,11 @@ var async = require('async'),
|
|||||||
}
|
}
|
||||||
|
|
||||||
async.parallel({
|
async.parallel({
|
||||||
|
mainPost: function(next) {
|
||||||
|
Topics.getMainPost(tid, uid, next);
|
||||||
|
},
|
||||||
posts: function(next) {
|
posts: function(next) {
|
||||||
posts.getPidsFromSet(set, start, end, reverse, function(err, pids) {
|
Topics.getTopicPosts(tid, set, start, end, uid, reverse, next);
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
pids = [topicData.mainPid].concat(pids);
|
|
||||||
posts.getPostsByPids(pids, tid, function(err, posts) {
|
|
||||||
if (err) {
|
|
||||||
return next(err);
|
|
||||||
}
|
|
||||||
start = parseInt(start, 10);
|
|
||||||
for(var i=0; i<posts.length; ++i) {
|
|
||||||
posts[i].index = start + i + 1;
|
|
||||||
}
|
|
||||||
Topics.addPostData(posts, uid, next);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
category: function(next) {
|
category: function(next) {
|
||||||
Topics.getCategoryData(tid, next);
|
Topics.getCategoryData(tid, next);
|
||||||
@@ -293,7 +280,7 @@ var async = require('async'),
|
|||||||
}
|
}
|
||||||
|
|
||||||
topicData.category = results.category;
|
topicData.category = results.category;
|
||||||
topicData.posts = results.posts;
|
topicData.posts = results.mainPost.concat(results.posts);
|
||||||
topicData.tags = results.tags;
|
topicData.tags = results.tags;
|
||||||
topicData.thread_tools = results.threadTools;
|
topicData.thread_tools = results.threadTools;
|
||||||
topicData.pageCount = results.pageCount;
|
topicData.pageCount = results.pageCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user