feat: add the user of the post to category teaser

This commit is contained in:
Barış Soner Uşaklı
2022-09-22 12:23:34 -04:00
parent cc4d320111
commit c3920ccb10

View File

@@ -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,
};
}
};