Implement POST /users/ids endpoint for APIv4 (#5274)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
177589b1e2
Коммит
ccb0343828
10
app/user.go
10
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user