mirror of
https://github.com/discourse/discourse.git
synced 2026-08-19 01:14:56 -05:00
FIX: Get all groups for user directory dropdown (#13566)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user