discourse/app/assets/javascripts/admin/addon/routes/admin-user-index.js
David Taylor 48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00

29 lines
755 B
JavaScript

import Group from "discourse/models/group";
import DiscourseRoute from "discourse/routes/discourse";
export default class AdminUserIndexRoute extends DiscourseRoute {
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: model.customGroups.mapBy("id"),
ssoExternalEmail: null,
ssoLastPayload: null,
model,
});
}
}