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
Этот коммит содержится в:
Phillip Ahereza
2019-07-05 22:19:40 +03:00
коммит произвёл Elias Nahum
родитель aa14c9bbdb
Коммит c34942afec
6 изменённых файлов: 53 добавлений и 48 удалений

Просмотреть файл

@@ -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 {