duffelhq / duffel-api-javascript

JavaScript client library for the Duffel API
https://duffel.com/docs
MIT License
36 stars 12 forks source link

Pagination in test mode #421

Closed jose-dataka closed 2 years ago

jose-dataka commented 2 years ago

Hi there, I am using a test token and I would like to know whether it exists any type of restriction in the number of pages, I am only receive one page in all requests. Thanks for your time.

sgerrand commented 2 years ago

👋 Thanks for raising this question. To clarify what you're asking so that I understand it better, when you say "I am only receive one page" do you mean that you're only receiving a small amount of flight offers and you'd like to receive more offers for your search request(s) so that you can paginate through more than one page?

jose-dataka commented 2 years ago

Hi there, right. I only received 50 records. But now we have changed the code and we don't use this module, we have integrated our own api rest module to get your data. Thanks.

sgerrand commented 2 years ago

Thanks for the clarification! Duffel's API supports pagination and you can control this through the listWithGenerator/0 function. An example of this pagination in action can be seen in https://github.com/duffelhq/duffel-api-javascript/blob/77f764e2aae6cca08b05e550ca4646e28452be0b/src/booking/OfferRequests/OfferRequests.spec.ts#L38-L52.

sgerrand commented 2 years ago

Beyond that, we're very interested to know what pain points you had with our library as we want to make it as easy to use as possible for our customers. If you'd rather discuss this privately, please get in contact with us via help@duffel.com so that we can continue the discussion.