FIX: Get all groups for user directory dropdown (#13566)

This commit is contained in:
Mark VanLandingham
2021-06-29 11:03:27 -05:00
committed by GitHub
parent 23930738a7
commit 717908f426
@@ -1,4 +1,5 @@
import Controller, { inject as controller } from "@ember/controller";
import Group from "discourse/models/group";
import { action } from "@ember/object";
import discourseDebounce from "discourse-common/lib/debounce";
import showModal from "discourse/lib/show-modal";
@@ -58,11 +59,11 @@ export default Controller.extend({
},
loadGroups() {
return this.store.findAll("group").then((groups) => {
return Group.findAll({ ignore_automatic: true }).then((groups) => {
const groupOptions = groups.map((group) => {
return {
name: group.name,
id: group.id,
name: group.full_name || group.name,
id: group.name,
};
});
this.set("groupOptions", groupOptions);
@@ -72,7 +73,7 @@ export default Controller.extend({
@action
groupChanged(_, groupAttrs) {
// First param is the group name, which include none or 'all groups'. Ignore this and look at second param.
this.set("group", groupAttrs.id ? groupAttrs.name : null);
this.set("group", groupAttrs.id);
},
@action