0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Removed @classic decorator from member route

no issue

- there was no need for the decorator as the class is up to date with Octane idioms after swapping `init()` for `constructor()`
- added a comment about the need for `member.get('id')`
This commit is contained in:
Kevin Ansfield 2021-08-31 09:37:44 +01:00
parent 0a698ec41f
commit 3bc226bef0

View file

@ -1,16 +1,14 @@
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import classic from 'ember-classic-decorator';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
@classic
export default class MembersRoute extends AuthenticatedRoute {
@service router;
_requiresBackgroundRefresh = true;
init() {
super.init(...arguments);
constructor() {
super(...arguments);
this.router.on('routeWillChange', (transition) => {
this.showUnsavedChangesModal(transition);
});
@ -36,6 +34,8 @@ export default class MembersRoute extends AuthenticatedRoute {
setupController(controller, member) {
super.setupController(...arguments);
if (this._requiresBackgroundRefresh) {
// `member` is passed directly in `<LinkTo>` so it can be a proxy
// object used by the sparse list requiring the use of .get()
controller.fetchMemberTask.perform(member.get('id'));
}
}