Migrate "User.GetProfilesByUsernames" to Sync by default (#11523)
* changed GetProfilesByUsernames signature * modified the UserStore interface to reflect changed made to the GetProfilesByUsernames function signature * modify usages of GetProfilesByUsernames * fix gofmt * fixed failing userstore tests
Этот коммит содержится в:
коммит произвёл
Elias Nahum
родитель
aa14c9bbdb
Коммит
c34942afec
@@ -625,11 +625,11 @@ func (a *App) GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[
|
||||
}
|
||||
|
||||
func (a *App) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) {
|
||||
result := <-a.Srv.Store.User().GetProfilesByUsernames(usernames, viewRestrictions)
|
||||
if result.Err != nil {
|
||||
return nil, result.Err
|
||||
users, err := a.Srv.Store.User().GetProfilesByUsernames(usernames, viewRestrictions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return a.sanitizeProfiles(result.Data.([]*model.User), asAdmin), nil
|
||||
return a.sanitizeProfiles(users, asAdmin), nil
|
||||
}
|
||||
|
||||
func (a *App) sanitizeProfiles(users []*model.User, asAdmin bool) []*model.User {
|
||||
|
||||
Ссылка в новой задаче
Block a user