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

✨ [REST API] Implement sorting functionality in /{scopeId}/roles API #4093

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

MDeLuise
Copy link
Contributor

@MDeLuise MDeLuise commented Aug 5, 2024

Summary

This pull request introduces sorting capabilities to the '/{scopeId}/roles' API endpoint by adding two new query parameters: sortDir and sortParam.

Details

  • sortDir: Accepts NULL/ASCENDING/DESCENDING, and determines the order of sorting.
  • sortParam: Defines the field by which the sorting is applied.

This enhancement mirrors the sorting functionality already available in other API endpoints, such as /devices. By using these parameters, users can now sort the roles information based on any specified field in either ascending or descending order.

Example Usage

To sort the roles information in ascending order by a specific field, the request would look like:
GET /{scopeId}/roles?sortDir=ASCENDING&sortParam=<field_name>
This update enhances the flexibility and usability of the API by providing consistent sorting behavior across different endpoints.

Implemented sorting functionality for the '/{scopeId}/roles' API by adding query parameters `sortDir` and `sortParam`. This feature allows sorting of roles information based on the specified field (`sortParam`) in either ascending or descending order
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 16.75%. Comparing base (9d86254) to head (df6f850).

Files Patch % Lines
...se/kapua/app/api/resources/v1/resources/Roles.java 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #4093   +/-   ##
==========================================
  Coverage      16.75%   16.75%           
  Complexity        22       22           
==========================================
  Files           2016     2016           
  Lines          52357    52357           
  Branches        4417     4417           
==========================================
  Hits            8773     8773           
  Misses         43184    43184           
  Partials         400      400           
Files Coverage Δ
.../app/api/resources/v1/resources/EndpointInfos.java 0.00% <ø> (ø)
...se/kapua/app/api/resources/v1/resources/Roles.java 0.00% <0.00%> (ø)

@Coduz Coduz added Bug This is a bug or an unexpected behaviour. Fix it! Enhancement This PR/Issue improves an part of Kapua labels Aug 6, 2024
@Coduz Coduz merged commit e97223b into eclipse-kapua:develop Aug 6, 2024
33 of 34 checks passed
@Coduz Coduz removed the Bug This is a bug or an unexpected behaviour. Fix it! label Aug 6, 2024
Coduz added a commit that referenced this pull request Aug 26, 2024
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
@MDeLuise MDeLuise deleted the improve-roleSort branch September 2, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants