From c9a36c532ea5663fd65b9fb47a29e0571fd09ea5 Mon Sep 17 00:00:00 2001 From: rob Date: Fri, 22 Jul 2022 16:01:02 -0400 Subject: [PATCH] include author's type --- app/services/post.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/services/post.js b/app/services/post.js index f2f3c32..5568857 100644 --- a/app/services/post.js +++ b/app/services/post.js @@ -207,6 +207,9 @@ class PostService extends SiteService { .limit(pagination.cpp) .populate(this.populatePost) .lean(); + posts.forEach((post) => { + post.author.type = post.authorType; + }); return posts; } @@ -244,6 +247,9 @@ class PostService extends SiteService { } const posts = await q.lean(); + posts.forEach((post) => { + post.author.type = post.authorType; + }); return posts; } @@ -286,6 +292,9 @@ class PostService extends SiteService { .select('+content') .populate(this.populatePost) .lean(); + + post.author.type = post.authorType; + return post; }