You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
limit
: Number of records to return100
, if the value in the query is greater than this amount, default to returning 200page
: Will be used to determine the offsetNOTE: 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
The text was updated successfully, but these errors were encountered: