[MM-16170] Migrate Team.GetTeamsByUserId to Sync by default (#11100)

* [MM-16170] Migrate Team.GetTeamsByUserId to Sync by default

* Fixing comments
Этот коммит содержится в:
Mounica Paladugu
2019-07-09 09:21:18 -07:00
коммит произвёл Joram Wilander
родитель 0ec609d159
Коммит ff89b2c8e1
9 изменённых файлов: 36 добавлений и 38 удалений

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

@@ -189,13 +189,13 @@ func (a *App) IsFirstUserAccount() bool {
// indexUser fetches the required information to index a user from the database and
// calls the elasticsearch interface method
func (a *App) indexUser(user *model.User) *model.AppError {
userTeams := <-a.Srv.Store.Team().GetTeamsByUserId(user.Id)
if userTeams.Err != nil {
return userTeams.Err
userTeams, err := a.Srv.Store.Team().GetTeamsByUserId(user.Id)
if err != nil {
return err
}
userTeamsIds := []string{}
for _, team := range userTeams.Data.([]*model.Team) {
for _, team := range userTeams {
userTeamsIds = append(userTeamsIds, team.Id)
}