From c3920ccb10d8ead2dcd9914bb1784bed3f6adfd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 22 Sep 2022 12:23:34 -0400 Subject: [PATCH] feat: add the user of the post to category teaser --- src/controllers/helpers.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js index dcb6f55e4c..d618bc59e2 100644 --- a/src/controllers/helpers.js +++ b/src/controllers/helpers.js @@ -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, }; } };