1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/routes/member.js
Rishabh Garg 1cf443b42e
Updated member management data (#1150)
no issue

- Updated hard-coded data in member management to use real values from API
2019-04-16 20:32:43 +05:30

28 lines
688 B
JavaScript

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
export default AuthenticatedRoute.extend({
model(params) {
this._isMemberUpdated = true;
return this.store.findRecord('member', params.member_id, {
reload: true
});
},
setupController(controller, model) {
this._super(...arguments);
if (!this._isMemberUpdated) {
controller.fetchMember.perform(model.get('id'));
}
},
deactivate() {
this._super(...arguments);
// clear the properties
this._isMemberUpdated = false;
},
titleToken() {
return this.controller.get('member.name');
}
});