mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 16:14:25 +03:00
1cbf310a7d
refs https://github.com/TryGhost/Team/issues/1734 refs https://github.com/TryGhost/Team/issues/559 refs https://github.com/TryGhost/Ghost/issues/14101 - switches to newer modal patterns ready for later Ember upgrades
27 lines
640 B
JavaScript
27 lines
640 B
JavaScript
import Controller from '@ember/controller';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
import {task} from 'ember-concurrency';
|
|
|
|
export default class CodeInjectionController extends Controller {
|
|
@service notifications;
|
|
@service settings;
|
|
|
|
@action
|
|
save() {
|
|
this.saveTask.perform();
|
|
}
|
|
|
|
@task
|
|
*saveTask() {
|
|
let notifications = this.notifications;
|
|
|
|
try {
|
|
return yield this.settings.save();
|
|
} catch (error) {
|
|
notifications.showAPIError(error, {key: 'code-injection.save'});
|
|
throw error;
|
|
}
|
|
}
|
|
}
|