2015-02-12 21:22:32 -07:00
|
|
|
import Ember from 'ember';
|
2015-05-25 21:10:50 -05:00
|
|
|
|
|
|
|
export default Ember.Controller.extend({
|
2014-07-31 21:36:20 +02:00
|
|
|
actions: {
|
|
|
|
save: function () {
|
2015-05-25 21:10:50 -05:00
|
|
|
var notifications = this.get('notifications');
|
2014-07-31 21:36:20 +02:00
|
|
|
|
|
|
|
return this.get('model').save().then(function (model) {
|
2015-05-25 21:10:50 -05:00
|
|
|
notifications.closePassive();
|
|
|
|
notifications.showSuccess('Settings successfully saved.');
|
2014-07-31 21:36:20 +02:00
|
|
|
|
|
|
|
return model;
|
|
|
|
}).catch(function (errors) {
|
2015-05-25 21:10:50 -05:00
|
|
|
notifications.closePassive();
|
|
|
|
notifications.showErrors(errors);
|
2014-07-31 21:36:20 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|