REFACTOR: admin-user-index route (#7534)
This commit is contained in:
parent
717aa764b6
commit
b8db702a02
|
@ -6,10 +6,9 @@ export default Discourse.Route.extend({
|
|||
},
|
||||
|
||||
afterModel(model) {
|
||||
if (this.currentUser.get("admin")) {
|
||||
const self = this;
|
||||
return Group.findAll().then(function(groups) {
|
||||
self._availableGroups = groups.filterBy("automatic", false);
|
||||
if (this.currentUser.admin) {
|
||||
return Group.findAll().then(groups => {
|
||||
this._availableGroups = groups.filterBy("automatic", false);
|
||||
return model;
|
||||
});
|
||||
}
|
||||
|
@ -17,7 +16,7 @@ export default Discourse.Route.extend({
|
|||
|
||||
setupController(controller, model) {
|
||||
controller.setProperties({
|
||||
originalPrimaryGroupId: model.get("primary_group_id"),
|
||||
originalPrimaryGroupId: model.primary_group_id,
|
||||
availableGroups: this._availableGroups,
|
||||
customGroupIdsBuffer: null,
|
||||
model
|
||||
|
|
Loading…
Reference in New Issue