diff options
author | Antti Ahti <antti.ahti@gmail.com> | 2015-10-14 18:27:03 +0300 |
---|---|---|
committer | Antti Ahti <antti.ahti@gmail.com> | 2015-10-14 18:27:03 +0300 |
commit | 1ab7034574de2229d3cfc49391e6579db37a3064 (patch) | |
tree | 64212e4e35cc06c6a9d24c53dad5843efea6a846 /api/team.go | |
parent | 830e8b04d9cbc5652ab8b23d469e1c75ff5f8516 (diff) | |
download | chat-1ab7034574de2229d3cfc49391e6579db37a3064.tar.gz chat-1ab7034574de2229d3cfc49391e6579db37a3064.tar.bz2 chat-1ab7034574de2229d3cfc49391e6579db37a3064.zip |
Use team display name in team switcher menu
- /teams/find_teams returns team objects instead of just team names
- use display_name in UI instead of name in the team switch menu
Diffstat (limited to 'api/team.go')
-rw-r--r-- | api/team.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/api/team.go b/api/team.go index 6aa5ec1bb..7148caac3 100644 --- a/api/team.go +++ b/api/team.go @@ -409,14 +409,12 @@ func findTeams(c *Context, w http.ResponseWriter, r *http.Request) { return } else { teams := result.Data.([]*model.Team) - - s := make([]string, 0, len(teams)) - + m := make(map[string]*model.Team) for _, v := range teams { - s = append(s, v.Name) + m[v.Id] = v } - w.Write([]byte(model.ArrayToJson(s))) + w.Write([]byte(model.TeamMapToJson(m))) } } |