From 56f283275494076bfae9aa06a2d5df0d8d8f9b5d Mon Sep 17 00:00:00 2001 From: "Fabien \"egg\" O'Carroll" Date: Wed, 11 Oct 2023 19:20:25 +0200 Subject: [PATCH] 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 --- ghost/admin/app/routes/editor/edit.js | 3 ++- ghost/admin/app/routes/lexical-editor/edit.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/routes/editor/edit.js b/ghost/admin/app/routes/editor/edit.js index c1b4ab3a4c..01225643a9 100644 --- a/ghost/admin/app/routes/editor/edit.js +++ b/ghost/admin/app/routes/editor/edit.js @@ -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); diff --git a/ghost/admin/app/routes/lexical-editor/edit.js b/ghost/admin/app/routes/lexical-editor/edit.js index 6dd1093dd3..59ba6619c5 100644 --- a/ghost/admin/app/routes/lexical-editor/edit.js +++ b/ghost/admin/app/routes/lexical-editor/edit.js @@ -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);