Added status=all by default to preview api

This commit is contained in:
Rish 2019-11-06 18:18:28 +07:00
parent 81b9018526
commit 77daa77e04

View File

@ -21,7 +21,8 @@ module.exports = {
permissions: true,
query(frame) {
const options = Object.assign(frame.options, {formats: 'html,plaintext', withRelated: ['authors']});
return models.Post.findOne(frame.data, options)
const data = Object.assign(frame.data, {status: 'all'});
return models.Post.findOne(data, options)
.then((model) => {
if (!model) {
throw new common.errors.NotFoundError({