mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Removed post only fields from pages
- As we introduced email_subject and send_email_when_published for post responses we don't want to return them for pages
This commit is contained in:
parent
d5aa38464b
commit
d47100168b
2 changed files with 12 additions and 2 deletions
|
@ -12,7 +12,7 @@ module.exports = {
|
||||||
|
|
||||||
if (models.meta) {
|
if (models.meta) {
|
||||||
frame.response = {
|
frame.response = {
|
||||||
pages: models.data.map(model => mapper.mapPost(model, frame)),
|
pages: models.data.map(model => mapper.mapPage(model, frame)),
|
||||||
meta: models.meta
|
meta: models.meta
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
frame.response = {
|
frame.response = {
|
||||||
pages: [mapper.mapPost(models, frame)]
|
pages: [mapper.mapPage(models, frame)]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -75,6 +75,15 @@ const mapPost = (model, frame) => {
|
||||||
return jsonModel;
|
return jsonModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const mapPage = (model, frame) => {
|
||||||
|
const jsonModel = mapPost(model, frame);
|
||||||
|
|
||||||
|
delete jsonModel.email_subject;
|
||||||
|
delete jsonModel.send_email_when_published;
|
||||||
|
|
||||||
|
return jsonModel;
|
||||||
|
};
|
||||||
|
|
||||||
const mapSettings = (attrs, frame) => {
|
const mapSettings = (attrs, frame) => {
|
||||||
url.forSettings(attrs);
|
url.forSettings(attrs);
|
||||||
extraAttrs.forSettings(attrs, frame);
|
extraAttrs.forSettings(attrs, frame);
|
||||||
|
@ -126,6 +135,7 @@ const mapMember = (model, frame) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.mapPost = mapPost;
|
module.exports.mapPost = mapPost;
|
||||||
|
module.exports.mapPage = mapPage;
|
||||||
module.exports.mapUser = mapUser;
|
module.exports.mapUser = mapUser;
|
||||||
module.exports.mapTag = mapTag;
|
module.exports.mapTag = mapTag;
|
||||||
module.exports.mapIntegration = mapIntegration;
|
module.exports.mapIntegration = mapIntegration;
|
||||||
|
|
Loading…
Add table
Reference in a new issue