Ghost/ghost/admin/app/controllers/settings/code-injection.js
Kevin Ansfield ad98a9a072 🎨 refactor settings screens to use ember-concurrency & gh-task-button
refs https://github.com/TryGhost/Ghost/issues/7865
- updates all settings screens to use EC tasks and `gh-task-button` to get save-state save buttons
- removes now-unused `settings-save` mixin
- moves the order of button color CSS so that grey buttons can change to green/red after completing
- removes the heading from `apps-loading` template so that there's no odd flash when loading slack/amp screens directly
2017-03-08 10:00:03 -07:00

19 lines
506 B
JavaScript

import Controller from 'ember-controller';
import injectService from 'ember-service/inject';
import {task} from 'ember-concurrency';
export default Controller.extend({
notifications: injectService(),
save: task(function* () {
let notifications = this.get('notifications');
try {
return yield this.get('model').save();
} catch (error) {
notifications.showAPIError(error, {key: 'code-injection.save'});
throw error;
}
})
});