mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Added missing page prop to v2 Content API posts
no-issue We have to wrap this in a check to make sure that `page` property is only returned if either: A) No `fields` param is passed (send back all fields) B) `fields` param is passed AND it includes the `page` field
This commit is contained in:
parent
38a05c0393
commit
7c4f177fee
@ -37,8 +37,12 @@ const mapPost = (model, frame) => {
|
||||
|
||||
if (utils.isContentAPI(frame)) {
|
||||
// Content api v2 still expects page prop
|
||||
if (jsonModel.type === 'page') {
|
||||
jsonModel.page = true;
|
||||
if (!frame.options.columns || frame.options.columns.includes('page')) {
|
||||
if (jsonModel.type === 'page') {
|
||||
jsonModel.page = true;
|
||||
} else {
|
||||
jsonModel.page = false;
|
||||
}
|
||||
}
|
||||
date.forPost(jsonModel);
|
||||
members.forPost(jsonModel, frame);
|
||||
|
Loading…
Reference in New Issue
Block a user