mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 18:35:11 +08:00
e5311ab645
* DEV: Discourse.Route -> DiscourseRoute with import * ran prettier on all routes * prettiered one more file
27 lines
645 B
JavaScript
27 lines
645 B
JavaScript
import DiscourseRoute from "discourse/routes/discourse";
|
|
import Group from "discourse/models/group";
|
|
|
|
export default DiscourseRoute.extend({
|
|
model() {
|
|
return this.modelFor("adminUser");
|
|
},
|
|
|
|
afterModel(model) {
|
|
if (this.currentUser.admin) {
|
|
return Group.findAll().then(groups => {
|
|
this._availableGroups = groups.filterBy("automatic", false);
|
|
return model;
|
|
});
|
|
}
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
controller.setProperties({
|
|
originalPrimaryGroupId: model.primary_group_id,
|
|
availableGroups: this._availableGroups,
|
|
customGroupIdsBuffer: null,
|
|
model
|
|
});
|
|
}
|
|
});
|