[MM-16182] Migrate Team.GetTeamsForUserWithPagination to Sync by default #11117 (#11235)

* [MM-16182] Migrate Team.GetTeamsForUserWithPagination to Sync by default #11117
+ Team.GetTeamsForUserWithPagination returns ([]*model.TeamMember, *model.AppError) now instead of StoreChannel.
+ Updated mock.
+ Updated tests to use new explicit async.

* Fix Whitespace from go fmt

* Changed team_store.go to not use explicit async.

* Fixed up files from the review
+ Dont reassign var to ms.
+ Avoid nesting of the fetch calls.
+ Directly return fetch instead of nil, err and team, nil.
Этот коммит содержится в:
Kyle Reczek
2019-06-20 00:42:09 -06:00
коммит произвёл Jesús Espino
родитель 33789a3523
Коммит 3c13b0e4e7
5 изменённых файлов: 39 добавлений и 41 удалений

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

@@ -675,11 +675,7 @@ func (a *App) GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model.
}
func (a *App) GetTeamMembersForUserWithPagination(userId string, page, perPage int) ([]*model.TeamMember, *model.AppError) {
result := <-a.Srv.Store.Team().GetTeamsForUserWithPagination(userId, page, perPage)
if result.Err != nil {
return nil, result.Err
}
return result.Data.([]*model.TeamMember), nil
return a.Srv.Store.Team().GetTeamsForUserWithPagination(userId, page, perPage)
}
func (a *App) GetTeamMembers(teamId string, offset int, limit int, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) {