mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-03 22:30:58 +01:00
feat: add the user of the post to category teaser
This commit is contained in:
@@ -371,11 +371,13 @@ helpers.trimChildren = function (category) {
|
||||
|
||||
helpers.setCategoryTeaser = function (category) {
|
||||
if (Array.isArray(category.posts) && category.posts.length && category.posts[0]) {
|
||||
const post = category.posts[0];
|
||||
category.teaser = {
|
||||
url: `${nconf.get('relative_path')}/post/${category.posts[0].pid}`,
|
||||
timestampISO: category.posts[0].timestampISO,
|
||||
pid: category.posts[0].pid,
|
||||
topic: category.posts[0].topic,
|
||||
url: `${nconf.get('relative_path')}/post/${post.pid}`,
|
||||
timestampISO: post.timestampISO,
|
||||
pid: post.pid,
|
||||
topic: post.topic,
|
||||
user: post.user,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user