Ghost/ghost/admin/app/controllers/modals/upload.js
Kevin Ansfield 61e5ebdd2f WIP: review uses of notifications.showErrors
issue #5409

`notifications.showErrors` was historically used to display multiple error notifications whether from validation errors or responses form the API. This usage needs to be reviewed as inline validations should handle the validation side and we should be displaying alerts for actual errors.

Eventually `notifications.showErrors` should be left unused and therefore removed.
2015-07-28 12:27:57 +01:00

24 lines
546 B
JavaScript

import Ember from 'ember';
export default Ember.Controller.extend({
notifications: Ember.inject.service(),
acceptEncoding: 'image/*',
actions: {
confirmAccept: function () {
var notifications = this.get('notifications');
this.get('model').save().then(function (model) {
return model;
}).catch(function (err) {
notifications.showAPIError(err);
});
},
confirmReject: function () {
return false;
}
}
});