mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 05:42:32 +03:00
Renamed email-preview
file to email-previews
refs https://github.com/TryGhost/Toolbox/issues/308 - I recently pluralised the API endpoint but never made the changes to the controller file and everywhere else it's needed - this commit cleans up that inconsistency so it should be clearer
This commit is contained in:
parent
1b108d2cdb
commit
68cffa62ae
@ -149,8 +149,8 @@ module.exports = {
|
||||
return shared.pipeline(require('./actions'), localUtils);
|
||||
},
|
||||
|
||||
get email_preview() {
|
||||
return shared.pipeline(require('./email-preview'), localUtils);
|
||||
get email_previews() {
|
||||
return shared.pipeline(require('./email-previews'), localUtils);
|
||||
},
|
||||
|
||||
get emails() {
|
||||
|
@ -288,8 +288,8 @@ module.exports = function apiRoutes() {
|
||||
router.get('/actions', mw.authAdminApi, http(api.actions.browse));
|
||||
|
||||
// ## Email Preview
|
||||
router.get('/email_previews/posts/:id', mw.authAdminApi, http(api.email_preview.read));
|
||||
router.post('/email_previews/posts/:id', mw.authAdminApi, http(api.email_preview.sendTestEmail));
|
||||
router.get('/email_previews/posts/:id', mw.authAdminApi, http(api.email_previews.read));
|
||||
router.post('/email_previews/posts/:id', mw.authAdminApi, http(api.email_previews.sendTestEmail));
|
||||
|
||||
// ## Emails
|
||||
router.get('/emails', mw.authAdminApi, http(api.emails.browse));
|
||||
|
@ -54,7 +54,7 @@ describe('Email Preview API', function () {
|
||||
should.exist(jsonResponse);
|
||||
should.exist(jsonResponse.email_previews);
|
||||
|
||||
localUtils.API.checkResponse(jsonResponse.email_previews[0], 'email_preview', null, null);
|
||||
localUtils.API.checkResponse(jsonResponse.email_previews[0], 'email_previews', null, null);
|
||||
});
|
||||
|
||||
it('can read post email preview with email card and replacements', async function () {
|
@ -165,7 +165,7 @@ const expectedProperties = {
|
||||
,
|
||||
email: _(schema.emails)
|
||||
.keys(),
|
||||
email_preview: ['html', 'subject', 'plaintext'],
|
||||
email_previews: ['html', 'subject', 'plaintext'],
|
||||
email_recipient: _(schema.email_recipients)
|
||||
.keys()
|
||||
.filter(key => key.indexOf('@@') === -1),
|
||||
|
@ -185,7 +185,7 @@ const expectedProperties = {
|
||||
'created_at',
|
||||
'updated_at'
|
||||
],
|
||||
email_preview: ['html', 'subject', 'plaintext']
|
||||
email_previews: ['html', 'subject', 'plaintext']
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
Loading…
Reference in New Issue
Block a user