mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Fixed success button state for POST ../email_previews/..
refs https://github.com/TryGhost/Toolbox/issues/308 - this endpoint is being switched to return a 204 with no body upon success - if we don't change this code, the button will get stuck in a red Retry state because it reads the `undefined` body and thinks it's an error - this commit makes sure we return true if the POST is successful
This commit is contained in:
parent
e1f05ed126
commit
7ea5bdcdf8
2 changed files with 4 additions and 2 deletions
|
@ -93,7 +93,8 @@ export default class Email extends Component {
|
|||
data,
|
||||
dataType: 'json'
|
||||
};
|
||||
return yield this.ajax.post(url, options);
|
||||
yield this.ajax.post(url, options);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (error) {
|
||||
let message = 'Email could not be sent, verify mail settings';
|
||||
|
|
|
@ -86,7 +86,8 @@ export default class ModalPostPreviewEmailComponent extends Component {
|
|||
dataType: 'json'
|
||||
};
|
||||
|
||||
return yield this.ajax.post(url, options);
|
||||
yield this.ajax.post(url, options);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (error) {
|
||||
let message = 'Email could not be sent, verify mail settings';
|
||||
|
|
Loading…
Add table
Reference in a new issue