Closed kylejbrk closed 4 years ago
Hi! Thank you for your effort. This code doesn't work unfortunately.
Whoops. I was putting the bundle data in next link. Should've tested first.
You also need to yield all items from the first request (which you get in next_link before the loop starts). Then get "next" link. And then you realize that you copypasted the half of the code from the while loop and maybe check "if next_link:" inside the loop is not that bad. But of course it'll be great if you'll find a more cleaner solution.
We can probably use part of your PR like this:
next_link = True
while next_link:
...
next_link = get_by_path(bundle_data, ['link', {'relation': 'next'}, 'url'])
And remove if not next_link: break
from the loop.
Not sure if it's anymore efficient but it's cleaner.