2018-10-19 15:17:02 +00:00
|
|
|
import SingleRoute from 'consul-ui/routing/single';
|
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
import { hash } from 'rsvp';
|
2019-05-01 18:09:29 +00:00
|
|
|
import { get } from '@ember/object';
|
2018-10-19 15:17:02 +00:00
|
|
|
|
|
|
|
import WithTokenActions from 'consul-ui/mixins/token/with-actions';
|
|
|
|
|
|
|
|
export default SingleRoute.extend(WithTokenActions, {
|
2018-10-26 17:40:51 +00:00
|
|
|
repo: service('repository/token'),
|
2018-10-19 15:17:02 +00:00
|
|
|
settings: service('settings'),
|
|
|
|
model: function(params, transition) {
|
|
|
|
return this._super(...arguments).then(model => {
|
|
|
|
return hash({
|
|
|
|
...model,
|
|
|
|
...{
|
|
|
|
token: get(this, 'settings').findBySlug('token'),
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
setupController: function(controller, model) {
|
|
|
|
controller.setProperties(model);
|
|
|
|
},
|
|
|
|
});
|