summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-03 09:30:57 -0500
committerCorey Hulen <corey@hulen.com>2017-02-03 09:30:57 -0500
commitccb034382850b7e8ea924a4559e47ef44203155c (patch)
tree72026c58e6bb8e8ad679ac07476906281ffbb1d5 /app
parent177589b1e26fcabd7749dd0fbe8c39999c206609 (diff)
downloadchat-ccb034382850b7e8ea924a4559e47ef44203155c.tar.gz
chat-ccb034382850b7e8ea924a4559e47ef44203155c.tar.bz2
chat-ccb034382850b7e8ea924a4559e47ef44203155c.zip
Implement POST /users/ids endpoint for APIv4 (#5274)
Diffstat (limited to 'app')
-rw-r--r--app/user.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/user.go b/app/user.go
index 5422d0b67..f9137b1e9 100644
--- a/app/user.go
+++ b/app/user.go
@@ -417,11 +417,17 @@ func GetUsersNotInChannel(teamId string, channelId string, offset int, limit int
}
}
-func GetUsersByIds(userIds []string) (map[string]*model.User, *model.AppError) {
+func GetUsersByIds(userIds []string, asAdmin bool) ([]*model.User, *model.AppError) {
if result := <-Srv.Store.User().GetProfileByIds(userIds, true); result.Err != nil {
return nil, result.Err
} else {
- return result.Data.(map[string]*model.User), nil
+ users := result.Data.([]*model.User)
+
+ for _, u := range users {
+ SanitizeProfile(u, asAdmin)
+ }
+
+ return users, nil
}
}