MM-16500: Adds ability to retrieve the total count of teams via the API. (#11325)
Этот коммит содержится в:
коммит произвёл
Miguel de la Cruz
родитель
49d5037a89
Коммит
c07b7046ca
12
app/team.go
12
app/team.go
@@ -613,6 +613,18 @@ func (a *App) GetAllTeamsPage(offset int, limit int) ([]*model.Team, *model.AppE
|
||||
return a.Srv.Store.Team().GetAllPage(offset, limit)
|
||||
}
|
||||
|
||||
func (a *App) GetAllTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) {
|
||||
totalCount, err := a.Srv.Store.Team().AnalyticsTeamCount()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
teams, err := a.Srv.Store.Team().GetAllPage(offset, limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &model.TeamsWithCount{Teams: teams, TotalCount: totalCount}, nil
|
||||
}
|
||||
|
||||
func (a *App) GetAllPrivateTeams() ([]*model.Team, *model.AppError) {
|
||||
result := <-a.Srv.Store.Team().GetAllPrivateTeamListing()
|
||||
if result.Err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user