mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
Removed the deprecated send_email_when_published
field from the API
refs https://github.com/TryGhost/Team/issues/457
This commit is contained in:
parent
9163c48f4e
commit
b724b2be92
@ -108,10 +108,6 @@ module.exports = {
|
||||
|
||||
forcePageFilter(frame);
|
||||
|
||||
if (frame.options.columns && frame.options.columns.includes('send_email_when_published')) {
|
||||
frame.options.columns.push('email_recipient_filter');
|
||||
}
|
||||
|
||||
/**
|
||||
* ## current cases:
|
||||
* - context object is empty (functional call, content api access)
|
||||
@ -140,10 +136,6 @@ module.exports = {
|
||||
|
||||
forcePageFilter(frame);
|
||||
|
||||
if (frame.options.columns && frame.options.columns.includes('send_email_when_published')) {
|
||||
frame.options.columns.push('email_recipient_filter');
|
||||
}
|
||||
|
||||
/**
|
||||
* ## current cases:
|
||||
* - context object is empty (functional call, content api access)
|
||||
|
@ -47,14 +47,6 @@ const mapPost = (model, frame) => {
|
||||
gating.forPost(jsonModel, frame);
|
||||
}
|
||||
|
||||
if (typeof jsonModel.email_recipient_filter === 'undefined') {
|
||||
jsonModel.send_email_when_published = null;
|
||||
} else if (jsonModel.email_recipient_filter === 'none') {
|
||||
jsonModel.send_email_when_published = false;
|
||||
} else {
|
||||
jsonModel.send_email_when_published = true;
|
||||
}
|
||||
|
||||
clean.post(jsonModel, frame);
|
||||
|
||||
if (frame.options && frame.options.withRelated) {
|
||||
@ -96,7 +88,6 @@ const mapPage = (model, frame) => {
|
||||
const jsonModel = mapPost(model, frame);
|
||||
|
||||
delete jsonModel.email_subject;
|
||||
delete jsonModel.send_email_when_published;
|
||||
delete jsonModel.email_recipient_filter;
|
||||
|
||||
return jsonModel;
|
||||
|
@ -44,7 +44,6 @@ const expectedProperties = {
|
||||
.concat(
|
||||
..._(schema.posts_meta).keys().without('post_id', 'id')
|
||||
)
|
||||
.concat('send_email_when_published')
|
||||
,
|
||||
|
||||
page: _(schema.posts)
|
||||
|
@ -174,22 +174,6 @@ describe('Posts Content API', function () {
|
||||
res.body.posts[0].url.should.eql('http://127.0.0.1:2369/welcome/');
|
||||
});
|
||||
|
||||
it('Can request send_email_when_published calculated field of posts', async function () {
|
||||
const res = await request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&fields=url&fields=send_email_when_published`))
|
||||
.set('Origin', testUtils.API.getURL())
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200);
|
||||
|
||||
const jsonResponse = res.body;
|
||||
|
||||
should.exist(jsonResponse.posts);
|
||||
|
||||
localUtils.API.checkResponse(jsonResponse.posts[0], 'post', false, false, ['url', 'send_email_when_published']);
|
||||
res.body.posts[0].url.should.eql('http://127.0.0.1:2369/welcome/');
|
||||
res.body.posts[0].send_email_when_published.should.eql(false);
|
||||
});
|
||||
|
||||
it('Can include relations', async function () {
|
||||
const res = await request.get(localUtils.API.getApiQuery(`posts/?key=${validKey}&include=tags,authors`))
|
||||
.set('Origin', testUtils.API.getURL())
|
||||
|
@ -36,7 +36,6 @@ const expectedProperties = {
|
||||
..._(schema.posts_meta).keys().without('post_id', 'id')
|
||||
)
|
||||
.concat('reading_time')
|
||||
.concat('send_email_when_published')
|
||||
,
|
||||
author: _(schema.users)
|
||||
.keys()
|
||||
|
@ -36,7 +36,6 @@ const expectedProperties = {
|
||||
.concat(
|
||||
..._(schema.posts_meta).keys().without('post_id', 'id')
|
||||
)
|
||||
.concat('send_email_when_published')
|
||||
,
|
||||
user: _(schema.users)
|
||||
.keys()
|
||||
|
@ -35,7 +35,6 @@ const expectedProperties = {
|
||||
..._(schema.posts_meta).keys().without('post_id', 'id')
|
||||
)
|
||||
.concat('reading_time')
|
||||
.concat('send_email_when_published')
|
||||
,
|
||||
author: _(schema.users)
|
||||
.keys()
|
||||
|
Loading…
Reference in New Issue
Block a user