0
Fork 0
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:
Daniel Lockyer 2022-04-26 11:47:01 +01:00
parent e1f05ed126
commit 7ea5bdcdf8
2 changed files with 4 additions and 2 deletions

View file

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

View file

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