From 95525eeadcc52dce2baea4b0f2874b30eb27b499 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 18 Jun 2020 13:59:01 +0100 Subject: [PATCH] Allowed `?formats` param in Admin API post+page create/edit requests no issue - `?formats` is useful when you want to get `html` back from the Admin API when creating/editing posts, otherwise you're forced to make a following `GET` request --- core/server/api/canary/pages.js | 2 ++ core/server/api/canary/posts.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/server/api/canary/pages.js b/core/server/api/canary/pages.js index c422055095..f60399ac8c 100644 --- a/core/server/api/canary/pages.js +++ b/core/server/api/canary/pages.js @@ -87,6 +87,7 @@ module.exports = { headers: {}, options: [ 'include', + 'formats', 'source' ], validation: { @@ -122,6 +123,7 @@ module.exports = { options: [ 'include', 'id', + 'formats', 'source', 'force_rerender', // NOTE: only for internal context diff --git a/core/server/api/canary/posts.js b/core/server/api/canary/posts.js index 7b77986171..26bab92fca 100644 --- a/core/server/api/canary/posts.js +++ b/core/server/api/canary/posts.js @@ -89,6 +89,7 @@ module.exports = { headers: {}, options: [ 'include', + 'formats', 'source', 'send_email_when_published' ], @@ -124,6 +125,7 @@ module.exports = { options: [ 'include', 'id', + 'formats', 'source', 'send_email_when_published', 'force_rerender',