[MM-16164] Migrate "Team.GetAll" to Sync by default (#11108)
* [MM-16164] Migrate "Team.GetAll" to Sync by default * Refactor to make code shorter and more descriptive
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
c243b6640c
Коммит
3b03c9afcb
@@ -357,16 +357,14 @@ func (s SqlTeamStore) SearchPrivate(term string) store.StoreChannel {
|
||||
})
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) GetAll() store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
var data []*model.Team
|
||||
if _, err := s.GetReplica().Select(&data, "SELECT * FROM Teams ORDER BY DisplayName"); err != nil {
|
||||
result.Err = model.NewAppError("SqlTeamStore.GetAllTeams", "store.sql_team.get_all.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
func (s SqlTeamStore) GetAll() ([]*model.Team, *model.AppError) {
|
||||
var teams []*model.Team
|
||||
|
||||
result.Data = data
|
||||
})
|
||||
_, err := s.GetReplica().Select(&teams, "SELECT * FROM Teams ORDER BY DisplayName")
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlTeamStore.GetAllTeams", "store.sql_team.get_all.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return teams, nil
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) GetAllPage(offset int, limit int) store.StoreChannel {
|
||||
|
||||
Ссылка в новой задаче
Block a user