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