Closed sugat009 closed 1 week ago
@sugat009 Thinking some more about API naming here (along with the iterator function, I propose these function signatures:
const getPage = (limit = 100, skip = 0) => Promise<Person.v1.Person[]>
const getAll = () => AsyncGenerator<Person.v1.Person, void>
Under the hood, getAll
can call getPage
. The main thing here is that I would like to encourage use of the getAll
instead of getPage
, so we do not have consumers trying to manually page through results unless it is necessary. For this issue, I think all this means is that you would need to change your function name from getAll
to getPage
. Let me know if this seems reasonable. Happy to discuss more!
@jkuester Of course, that sounds good.
I am removing this from the 4.11 milestone since it is covered already by https://github.com/medic/cht-core/issues/9241.
Is your feature request related to a problem? Please describe.
This feature is part of the bigger feature of the creation of API endpoints for getting contacts by type. (#9193) The target of this feature is to have the functionality of getting people using
cht-datasource
with the option of pagination.Describe the solution you'd like
As mentioned in the parent ticket:
limit
- default value is100
skip
- default value is0
Describe alternatives you've considered
Additional context