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

Paginate GET access_control_privileges endpoint #1630

Open
4 tasks done
ianliuwk1019 opened this issue Oct 10, 2024 · 0 comments
Open
4 tasks done

Paginate GET access_control_privileges endpoint #1630

ianliuwk1019 opened this issue Oct 10, 2024 · 0 comments
Assignees

Comments

@ianliuwk1019
Copy link
Collaborator

ianliuwk1019 commented Oct 10, 2024

Description

Paginate the results displayed on the Delegated Admin table
Image

Endpoint design:

  • Updating the endpoint name to use dashes instead of underscores
    • /access_control_privileges?{application_id} to /access-control-privileges?{application_id}
    • /access_control_privileges/{access_control_privilege_id} to access-control-privileges/{access-control-privilege-id}
    • Refactor areas that use these endpoints, e.g. tests, front-end
  • Default: /access-control-privileges?{application_id}
    • Will sort by updated_dated, page = 1, page size = 50
  • with pagination: /access-control-privileges?{application_id}&page={pageNumber}&size={pageSize}
    • if one of them is missing, then use the default values, e.g. if page number is 1 and no pageSize is provided, then use the default 50 for pageSize
  • with Sort /access_control_privileges?{application_id}&sortBy={columnName}
    • should reject a call if an invalid column name is provided, 400 Bad request
    • default page number and page size should apply if not present
  • with Search /access-control-privileges?{application_id}&search={keyWord}
    • should be able to encode and decode search string, e.g. a space would be %20
    • default page number and page size should apply if not present
  • maintain the current privileges
  • should return an x-total-count header
  • return an Empty list [] if there's no hit

Acceptance Criteria

  • [ ] An x-total-count header
  • A page number that starts with 1 defaulted to 1, a page size defaulted to 50, with a max limit of 100 items per page.
  • Sort by columns, default sort by username create_date, should be able to sort by all columns
  • Search by keyword on columns [ username, full name, email, client number, Role display_name]
  • Make a PR to a feature branch

Additional Context
We will be adding forest client name to this endpoint later.
This will break frontend's user table if deployed, so it should be deployed to a feature branch, the feature branch will be merged to main once frontend is ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant