include author's type

master
rob 2 years ago
parent 06924946bd
commit c9a36c532e

@ -207,6 +207,9 @@ class PostService extends SiteService {
.limit(pagination.cpp) .limit(pagination.cpp)
.populate(this.populatePost) .populate(this.populatePost)
.lean(); .lean();
posts.forEach((post) => {
post.author.type = post.authorType;
});
return posts; return posts;
} }
@ -244,6 +247,9 @@ class PostService extends SiteService {
} }
const posts = await q.lean(); const posts = await q.lean();
posts.forEach((post) => {
post.author.type = post.authorType;
});
return posts; return posts;
} }
@ -286,6 +292,9 @@ class PostService extends SiteService {
.select('+content') .select('+content')
.populate(this.populatePost) .populate(this.populatePost)
.lean(); .lean();
post.author.type = post.authorType;
return post; return post;
} }

Loading…
Cancel
Save