Closed eriko closed 9 years ago
That is the intended usage. I will have to look in to this.
On Wed, Nov 12, 2014 at 5:21 PM, Erik Ordway notifications@github.com wrote:
client.list_enrollments_sections(c_section.id, {type: 'StudentEnrollment', state: 'active'})
list_enrollments_sections only returns the first ten records. In the code there is something about sending next_page and I have tried client.list_enrollments_sections(c_section.id, {type: 'StudentEnrollment',state: 'active',next_page: true}) to no avail. How do you get the next pages?
— Reply to this email directly or view it on GitHub https://github.com/instructure/pandarus/issues/8.
I still think I may be doing something wrong as I can not figure out how to do it in the context of earlier requests.
In looking through the pandarus code I do not see any thing handling the link headers https://canvas.instructure.com/doc/api/file.pagination.html . One of the things the canvas_api project did was use those and add a conditional .more? to the arrays and then be able to call .next_page! and .last_page!, etc on the array of values.
It's handled by Footrest pagination.rb, using link_header
On Thu, Nov 13, 2014 at 10:18 AM, Erik Ordway notifications@github.com wrote:
In looking through the pandarus code I do not see any thing handling the link headers https://canvas.instructure.com/doc/api/file.pagination.html . One of the things the canvas_api project did was use those and add a conditional .more? to the arrays and then be able to call .next_page! and .last_page!, etc on the array of values.
— Reply to this email directly or view it on GitHub https://github.com/instructure/pandarus/issues/8#issuecomment-62930082.
Ok I am a partial idiot. I was testing against a course that was too small. That said when there is no more, in this case enrollments, it keeps returning the last set. This makes it hard to stop asking for more.
The new paging code in remote_collections seems to be much nicer. Thanks.
client.list_enrollments_sections(c_section.id, {type: 'StudentEnrollment', state: 'active'})
list_enrollments_sections only returns the first ten records. In the code there is something about sending
next_page
and I have triedclient.list_enrollments_sections(c_section.id, {type: 'StudentEnrollment',state: 'active',next_page: true})
to no avail. How do you get the next pages?