0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Explicitly set include for posts/pages in editor

We want to remove the post_revisions default include from the API but it's
required for the post history feature in the editor. Because the default include
is only applied when no include is sent, we have to set the entire string,
rather than just the missing post_revision related fields
This commit is contained in:
Fabien "egg" O'Carroll 2023-10-11 19:20:25 +02:00 committed by Fabien 'egg' O'Carroll
parent 534435a634
commit 56f2832754
2 changed files with 4 additions and 2 deletions

View file

@ -31,7 +31,8 @@ export default class EditRoute extends AuthenticatedRoute {
let query = {
// eslint-disable-next-line camelcase
id: post_id
id: post_id,
include: 'tags,authors,authors.roles,email,tiers,newsletter,count.clicks,post_revisions,post_revisions.author'
};
const records = await this.store.query(modelName, query);

View file

@ -27,7 +27,8 @@ export default class EditRoute extends AuthenticatedRoute {
let query = {
// eslint-disable-next-line camelcase
id: post_id
id: post_id,
include: 'tags,authors,authors.roles,email,tiers,newsletter,count.clicks,post_revisions,post_revisions.author'
};
const records = await this.store.query(modelName, query);