Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pagination in Requests #210

Closed
nelsonic opened this issue Oct 9, 2022 · 2 comments
Closed

Pagination in Requests #210

nelsonic opened this issue Oct 9, 2022 · 2 comments

Comments

@nelsonic
Copy link
Contributor

nelsonic commented Oct 9, 2022

Hi! 👋
Trying to use tentacat to retrieve a list of Org Members from GitHub. 🤞
The API endpoint for List organization members:
https://docs.github.com/en/rest/orgs/members#list-organization-members
Includes a page option to paginate the results.
We are trying to retrieve a list of members from an Org that has several hundred
and therefore we need to fetch multiple pages ...

Our reading of the Tentacat.Organizations.Members.list/2 docs/code:

@doc """
List members of a `organization`.
The response will differ if the authenticated user is also owner of the
organization.
## Example
Tentacat.Organizations.Members.list "github"
Tentacat.Organizations.Members.list client, "github"
More info at: http://developer.github.com/v3/orgs/members/#members-list
"""
@spec list(Client.t(), binary) :: Tentacat.response()
def list(client \\ %Client{}, organization) do
get("orgs/#{organization}/members", client)
end

It appears to only allow passing the client and organisation, i.e. no page ... 🤷‍♂️
Can someone please confirm our understanding and inform if there is a way to request page=2 of the results? ✌️
Thanks very much! 🙏

@edgurgel
Copy link
Owner

Hi there! Yeah we might need to accept a third argument options where you can pass page: 1, role or whatever other option this endpoint accepts

@nelsonic
Copy link
Contributor Author

PR: https://github.com/edgurgel/tentacat/pull/220/files

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants