Skip to content

Commit 1891239

Browse files
authored
Fix pagination for ListCopilotSeats (#3112)
1 parent 8bec011 commit 1891239

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

github/copilot.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,12 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co
161161
//meta:operation GET /orgs/{org}/copilot/billing/seats
162162
func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) {
163163
u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org)
164+
u, err := addOptions(u, opts)
165+
if err != nil {
166+
return nil, nil, err
167+
}
164168

165-
req, err := s.client.NewRequest("GET", u, opts)
169+
req, err := s.client.NewRequest("GET", u, nil)
166170
if err != nil {
167171
return nil, nil, err
168172
}

github/copilot_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,9 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) {
584584

585585
const methodName = "ListCopilotSeats"
586586

587+
opts := &ListOptions{Page: 2}
587588
testBadOptions(t, methodName, func() (err error) {
588-
_, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil)
589+
_, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", opts)
589590
return err
590591
})
591592

0 commit comments

Comments
 (0)