feat: move postercount to topic hash

This commit is contained in:
Barış Soner Uşaklı
2020-10-24 21:14:52 -04:00
parent 203db47b30
commit 0db0231cff
7 changed files with 40 additions and 5 deletions

View File

@@ -146,7 +146,6 @@ Topics.getTopicWithPosts = async function (topicData, set, uid, start, stop, rev
deleter,
merger,
related,
posterCount,
] = await Promise.all([
getMainPostAndReplies(topicData, set, uid, start, stop, reverse),
categories.getCategoryData(topicData.cid),
@@ -158,7 +157,6 @@ Topics.getTopicWithPosts = async function (topicData, set, uid, start, stop, rev
getDeleter(topicData),
getMerger(topicData),
getRelated(topicData, uid),
db.sortedSetCard('tid:' + topicData.tid + ':posters'),
]);
topicData.posts = posts;
@@ -181,7 +179,6 @@ Topics.getTopicWithPosts = async function (topicData, set, uid, start, stop, rev
topicData.mergedTimestampISO = utils.toISOString(topicData.mergedTimestamp);
}
topicData.related = related || [];
topicData.posterCount = posterCount;
topicData.unreplied = topicData.postcount === 1;
topicData.icons = [];