Skip to content

Commit

Permalink
Enable automatic pagination with .limit arg
Browse files Browse the repository at this point in the history
  • Loading branch information
ateucher committed Jun 10, 2024
1 parent 1573df0 commit b4c0818
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/list_teams.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ list_team_members <- function(team, org = "openscapes", names_only = TRUE, ...)
team <- tolower(team)
org <- tolower(org)
org_teams <- tolower(list_teams(org))


if (!team %in% org_teams) {
stop("'", team, "' is not part of the '", org, "' organization",
Expand All @@ -31,7 +30,8 @@ list_team_members <- function(team, org = "openscapes", names_only = TRUE, ...)
"GET /orgs/{org}/teams/{team_slug}/members",
org = org,
team_slug = team,
...
...,
.limit = Inf
)

if (!names_only) return(team_members)
Expand All @@ -57,7 +57,7 @@ list_team_members <- function(team, org = "openscapes", names_only = TRUE, ...)
list_teams <- function(org = "openscapes", names_only = TRUE, ...) {
check_gh_pat()

teams <- gh("GET /orgs/{org}/teams", org = org)
teams <- gh("GET /orgs/{org}/teams", org = org, ..., .limit = Inf)

if (!names_only) return(teams)

Expand Down

0 comments on commit b4c0818

Please sign in to comment.