Fixed test preview mail for draft posts

This commit is contained in:
Rish 2019-11-06 17:02:42 +07:00
parent 30f8cfddb4
commit 90af59d15c

View File

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