Removed the deprecated send_email_when_published field from the API

refs https://github.com/TryGhost/Team/issues/457
This commit is contained in:
Thibaut Patel 2021-01-27 14:50:09 +01:00 committed by Daniel Lockyer
parent 9163c48f4e
commit b724b2be92
No known key found for this signature in database
GPG Key ID: FFBC6FA2A6F6ABC1
7 changed files with 0 additions and 37 deletions

View File

@ -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)

View File

@ -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;

View File

@ -44,7 +44,6 @@ const expectedProperties = {
.concat(
..._(schema.posts_meta).keys().without('post_id', 'id')
)
.concat('send_email_when_published')
,
page: _(schema.posts)

View File

@ -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())

View File

@ -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()

View File

@ -36,7 +36,6 @@ const expectedProperties = {
.concat(
..._(schema.posts_meta).keys().without('post_id', 'id')
)
.concat('send_email_when_published')
,
user: _(schema.users)
.keys()

View File

@ -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()