mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add thumbs to category data return
This commit is contained in:
@@ -115,6 +115,17 @@ Topics.getTopicsByTids = async function (tids, options) {
|
||||
result.topics.forEach(function (topic, i) {
|
||||
if (topic) {
|
||||
topic.thumbs = result.thumbs[i];
|
||||
// Note: Backwards compatibility with old thumb logic, remove in v1.16.0
|
||||
if (topic.thumb && !topic.thumbs.length) {
|
||||
topic.thumbs = [{
|
||||
id: topic.tid,
|
||||
name: path.basename(topic.thumb),
|
||||
url: topic.thumb,
|
||||
}];
|
||||
} else if (topic.thumbs.length) {
|
||||
topic.thumb = topic.thumbs[0].url;
|
||||
}
|
||||
// end
|
||||
topic.category = result.categoriesMap[topic.cid];
|
||||
topic.user = topic.uid ? result.usersMap[topic.uid] : { ...result.usersMap[topic.uid] };
|
||||
if (result.tidToGuestHandle[topic.tid]) {
|
||||
|
||||
Reference in New Issue
Block a user