Skip to content

Commit

Permalink
Fix pagination for ListCopilotSeats (#3112)
Browse files Browse the repository at this point in the history
  • Loading branch information
alinbalutoiu authored Mar 26, 2024
1 parent 8bec011 commit 1891239
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion github/copilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co
//meta:operation GET /orgs/{org}/copilot/billing/seats
func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) {
u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org)
u, err := addOptions(u, opts)
if err != nil {
return nil, nil, err
}

req, err := s.client.NewRequest("GET", u, opts)
req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion github/copilot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,9 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {

const methodName = "ListCopilotSeats"

opts := &ListOptions{Page: 2}
testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil)
_, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", opts)
return err
})

Expand Down

0 comments on commit 1891239

Please # to comment.