[MM-49243] - Use paged requests to request the list of teams (#26278)
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
087c993bed
Коммит
4bbcfd74ad
@@ -188,7 +188,9 @@ func createCommandCmdF(c client.Client, cmd *cobra.Command, args []string) error
|
||||
func listCommandCmdF(c client.Client, cmd *cobra.Command, args []string) error {
|
||||
var teams []*model.Team
|
||||
if len(args) < 1 {
|
||||
teamList, _, err := c.GetAllTeams(context.TODO(), "", 0, 10000)
|
||||
teamList, err := getPages(func(page, numPerPage int, etag string) ([]*model.Team, *model.Response, error) {
|
||||
return c.GetAllTeams(context.TODO(), etag, page, numPerPage)
|
||||
}, DefaultPageSize)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user