From 189123903e78a8697f19baa1633b1c10a1603373 Mon Sep 17 00:00:00 2001 From: Alin Balutoiu Date: Tue, 26 Mar 2024 19:11:42 +0000 Subject: [PATCH] Fix pagination for ListCopilotSeats (#3112) --- github/copilot.go | 6 +++++- github/copilot_test.go | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/github/copilot.go b/github/copilot.go index 51c938c9748..50e05253ce5 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -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 } diff --git a/github/copilot_test.go b/github/copilot_test.go index c65fda0f217..bc295af3a61 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -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 })