Skip to content
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

Add functionality of getting people with pagination in cht-datasource #9237

Closed
sugat009 opened this issue Jul 3, 2024 · 3 comments
Closed
Assignees
Labels
Type: Feature Add something new

Comments

@sugat009
Copy link
Member

sugat009 commented Jul 3, 2024

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

Person.v1.getAll(limit, skip);

As mentioned in the parent ticket:

  • limit - default value is 100
  • skip - default value is 0

Describe alternatives you've considered

Additional context

@sugat009 sugat009 added the Type: Feature Add something new label Jul 3, 2024
@sugat009 sugat009 self-assigned this Jul 3, 2024
@sugat009 sugat009 moved this from Todo to This Week's commitments in Product Team Activities Jul 3, 2024
@jkuester
Copy link
Contributor

@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!

@sugat009
Copy link
Member Author

@jkuester Of course, that sounds good.

sugat009 added a commit that referenced this issue Jul 19, 2024
sugat009 added a commit that referenced this issue Jul 23, 2024
sugat009 added a commit that referenced this issue Jul 24, 2024
sugat009 added a commit that referenced this issue Jul 26, 2024
sugat009 added a commit that referenced this issue Jul 31, 2024
sugat009 added a commit that referenced this issue Aug 12, 2024
sugat009 added a commit that referenced this issue Aug 12, 2024
sugat009 added a commit that referenced this issue Aug 12, 2024
sugat009 added a commit that referenced this issue Aug 12, 2024
sugat009 added a commit that referenced this issue Aug 12, 2024
sugat009 added a commit that referenced this issue Aug 12, 2024
@jkuester
Copy link
Contributor

I am removing this from the 4.11 milestone since it is covered already by #9241.

@jkuester jkuester removed this from the 4.11.0 milestone Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Add something new
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants