Ghost/ghost/admin/app/models/email.js
Kevin Ansfield a3c17c2757 Added failed state with retry button to PSM email pane
no issue

- follow similar retry-then-poll behaviour as the confirm email modal
2019-11-25 13:20:16 +00:00

31 lines
815 B
JavaScript

import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import {belongsTo} from 'ember-data/relationships';
import {equal} from '@ember/object/computed';
export default Model.extend({
emailCount: attr('number'),
error: attr('string'),
html: attr('string'),
plaintext: attr('string'),
stats: attr('json-string'),
status: attr('string'),
subject: attr('string'),
submittedAtUTC: attr('moment-utc'),
uuid: attr('string'),
createdAtUTC: attr('moment-utc'),
createdBy: attr('string'),
updatedAtUTC: attr('moment-utc'),
updatedBy: attr('string'),
post: belongsTo('post'),
isSuccess: equal('status', 'submitted'),
isFailure: equal('status', 'failed'),
retry() {
return this.store.adapterFor('email').retry(this);
}
});