mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Renamed /email_preview
endpoint to /email_previews
refs https://github.com/TryGhost/Toolbox/issues/308 - we have a pattern of using plurals for endpoints but `email_preview` was implemented without it - in v5, we're fixing that so we need to update Admin to take that into account
This commit is contained in:
parent
d0ce852ded
commit
bc6ce7a2dd
3 changed files with 4 additions and 4 deletions
|
@ -87,7 +87,7 @@ export default class Email extends Component {
|
|||
return false;
|
||||
}
|
||||
this.set('sendTestEmailError', '');
|
||||
const url = this.ghostPaths.url.api('/email_preview/posts', resourceId);
|
||||
const url = this.ghostPaths.url.api('/email_previews/posts', resourceId);
|
||||
const data = {emails: [testEmail]};
|
||||
const options = {
|
||||
data,
|
||||
|
|
|
@ -81,7 +81,7 @@ export default class EmailPreviewModal extends Component {
|
|||
subject = this.args.data.email.subject;
|
||||
// data is a post? try fetching email preview
|
||||
} else {
|
||||
let url = this.ghostPaths.url.api('/email_preview/posts', this.args.data.id);
|
||||
let url = this.ghostPaths.url.api('/email_previews/posts', this.args.data.id);
|
||||
let response = await this.ajax.request(url);
|
||||
let [emailPreview] = response.email_previews;
|
||||
html = emailPreview.html;
|
||||
|
|
|
@ -79,7 +79,7 @@ export default class ModalPostPreviewEmailComponent extends Component {
|
|||
}
|
||||
this.sendPreviewEmailError = '';
|
||||
|
||||
const url = this.ghostPaths.url.api('/email_preview/posts', resourceId);
|
||||
const url = this.ghostPaths.url.api('/email_previews/posts', resourceId);
|
||||
const data = {emails: [testEmail], memberSegment: this.memberSegment};
|
||||
const options = {
|
||||
data,
|
||||
|
@ -137,7 +137,7 @@ export default class ModalPostPreviewEmailComponent extends Component {
|
|||
subject = post.email.subject;
|
||||
// model is a post, fetch email preview
|
||||
} else {
|
||||
let url = new URL(this.ghostPaths.url.api('/email_preview/posts', post.id), window.location.href);
|
||||
let url = new URL(this.ghostPaths.url.api('/email_previews/posts', post.id), window.location.href);
|
||||
url.searchParams.set('memberSegment', this.memberSegment);
|
||||
|
||||
let response = await this.ajax.request(url.href);
|
||||
|
|
Loading…
Add table
Reference in a new issue