Ghost/ghost/admin/app/routes/member.js
Rishabh Garg c72e7b6040 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

29 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');
}
});