-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paginator does not appear to work #48
Comments
Here's how I did it for tags: def nation_builder_tags
return [] unless nation_builder_linked?
response = nb.call(:people_tags, :index, limit: TAGS_PER_PAGE)
paginated = NationBuilder::Paginator.new(nb, response)
list = []
loop do
list += paginated.body['results']
break unless paginated.next?
paginated = paginated.next
end
list
end
|
I can see how that could work because you don't have any query params other than |
Interesting. Do you have a code sample to reproduce this? Looking at the code it relies on what comes back from the API to return the parameters, and a simple test works for me:
I don't filter the way you mention, so I'm just going on my observations here. |
It just seems to call the same endpoint again, copying the
limit
param from the first request, but not including thenonce
ortoken
params given in thenext
orprev
properties of the returned JSON. Any other optional params to the original request (e.g. arguments to the people search endpoint likeupdated_since
) are also dropped. I ended up having to write my own pagination code. Am I missing something?The text was updated successfully, but these errors were encountered: