mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Changed /email_previews/posts/<post id>
endpoint to return 204 upon success
refs https://github.com/TryGhost/Toolbox/issues/308 - this endpoint is currently used to send a test email with the post - it currently returns a 200 with whatever the response of the mail service is - this body isn't used in Admin nor is useful generally because it just contains the ID of the mailgun response - it's better than we change it to 204 and no response - this commit does that and updates the tests
This commit is contained in:
parent
b123a9bb77
commit
f82ff87177
@ -43,7 +43,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
sendTestEmail: {
|
||||
statusCode: 200,
|
||||
statusCode: 204,
|
||||
headers: {},
|
||||
options: [
|
||||
'id'
|
||||
|
@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
// @TODO remove for 5.0
|
||||
// This should be a default serializer, not a passthrough, as per the read endpoint
|
||||
sendTestEmail(data, apiConfig, frame) {
|
||||
frame.response = data;
|
||||
}
|
||||
};
|
@ -109,10 +109,6 @@ module.exports = {
|
||||
return require('./site');
|
||||
},
|
||||
|
||||
get email_previews() {
|
||||
return require('./email-previews');
|
||||
},
|
||||
|
||||
get custom_theme_settings() {
|
||||
return require('./custom-theme-settings');
|
||||
},
|
||||
|
@ -139,10 +139,8 @@ describe('Email Preview API', function () {
|
||||
.send({
|
||||
emails: ['test@ghost.org']
|
||||
})
|
||||
.set('Accept', 'application/json')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
.expect(204)
|
||||
.expect((res) => {
|
||||
res.body.should.be.empty();
|
||||
});
|
||||
@ -168,10 +166,8 @@ describe('Email Preview API', function () {
|
||||
.send({
|
||||
emails: ['test@ghost.org']
|
||||
})
|
||||
.set('Accept', 'application/json')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
.expect(204)
|
||||
.expect((res) => {
|
||||
res.body.should.be.empty();
|
||||
});
|
||||
@ -199,10 +195,8 @@ describe('Email Preview API', function () {
|
||||
.send({
|
||||
emails: ['test@ghost.org']
|
||||
})
|
||||
.set('Accept', 'application/json')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect('Cache-Control', testUtils.cacheRules.private)
|
||||
.expect(200)
|
||||
.expect(204)
|
||||
.expect((res) => {
|
||||
res.body.should.be.empty();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user