Fixed post not showing authors in email

no issue
This commit is contained in:
Rish 2019-11-14 10:45:05 +05:30
parent eaf7289af3
commit 6d1de1b912
2 changed files with 2 additions and 3 deletions

View File

@ -52,7 +52,7 @@ module.exports = {
permissions: true,
async query(frame) {
const options = Object.assign(frame.options, {status: 'all'});
let model = await models.Post.findOne(options);
let model = await models.Post.findOne(options, {withRelated: ['authors']});
if (!model) {
throw new common.errors.NotFoundError({
message: common.i18n.t('errors.api.posts.postNotFound')

View File

@ -166,8 +166,7 @@ async function listener(emailModel, options) {
if (options && options.importing) {
return;
}
const postModel = await models.Post.findOne({id: emailModel.get('post_id')});
const postModel = await models.Post.findOne({id: emailModel.get('post_id')}, {withRelated: ['authors']});
const post = await serialize(postModel);