mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 08:31:43 +03:00
6e11a24002
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
31 lines
704 B
JavaScript
31 lines
704 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 UnsplashController extends Controller {
|
|
@service notifications;
|
|
@service settings;
|
|
|
|
@action
|
|
update(value) {
|
|
this.settings.set('unsplash', value);
|
|
}
|
|
|
|
@action
|
|
save() {
|
|
this.saveTask.perform();
|
|
}
|
|
|
|
@task({drop: true})
|
|
*saveTask() {
|
|
try {
|
|
yield this.settings.validate();
|
|
return yield this.settings.save();
|
|
} catch (error) {
|
|
this.notifications.showAPIError(error);
|
|
throw error;
|
|
}
|
|
}
|
|
}
|