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

ListUsers API route should support pagination #196

Open
1 task
Tracked by #493
asmahood opened this issue Apr 10, 2021 · 0 comments
Open
1 task
Tracked by #493

ListUsers API route should support pagination #196

asmahood opened this issue Apr 10, 2021 · 0 comments
Labels
type::Feature Issues/Pull requests that implement a new feature/enhancement work::Product Development

Comments

@asmahood
Copy link
Member

asmahood commented Apr 10, 2021

Description

Currently the list users endpoints returns the entire list of users from the database and returns it to the client. This makes for a signicantly long response time and also a memory issue as we are required to store all of these records in memory and then send them in the response. We should aim to reduce this problem using pagination

Approach

  • Add support on the list users endpoint for 2 new query parameters
    • limit: Number of records to return
      • Maximum allowed limit is 100, if the value in the query is greater than this amount, default to returning 200
    • page: Will be used to determine the offset
      • This number should be >= 1
  • Using these new parameters, add the appropriate clauses to the SQL query to limit and offset the response
  • Modify the response to return
{
	"users": [...] // Existing Response
	"totalUsers": // Count of all users in the database
}

NOTE: If these query parameters are not present, for now we will return all users. This is to keep backwards compatibility with the app until it gets updated with a pagination component.


Related To

Blocked By

Blocks

@asmahood asmahood transferred this issue from uwpokerclub/developer-hub Aug 2, 2023
@fugitive-cat fugitive-cat self-assigned this Oct 8, 2023
@asmahood asmahood added type::Feature Issues/Pull requests that implement a new feature/enhancement work::Product Development labels Oct 18, 2023
@asmahood asmahood changed the title Add pagination to users page Add pagination to list users route Feb 7, 2024
@asmahood asmahood changed the title Add pagination to list users route ListUsers API route should support pagination Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::Feature Issues/Pull requests that implement a new feature/enhancement work::Product Development
Projects
None yet
Development

No branches or pull requests

2 participants