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}/groups API #4094

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}/groups' 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 groups 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}/groups?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}/groups' API by adding query parameters `sortDir` and `sortParam`. This feature allows sorting of groups 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 (caf9a86).
Report is 2 commits behind head on develop.

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

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4094      +/-   ##
=============================================
- Coverage      16.75%   16.75%   -0.01%     
  Complexity        22       22              
=============================================
  Files           2016     2016              
  Lines          52357    52359       +2     
  Branches        4417     4418       +1     
=============================================
  Hits            8773     8773              
- Misses         43184    43186       +2     
  Partials         400      400              
Files Coverage Δ
...e/kapua/app/api/resources/v1/resources/Groups.java 0.00% <0.00%> (ø)

@Coduz Coduz added the Enhancement This PR/Issue improves an part of Kapua label Aug 6, 2024
@Coduz Coduz merged commit fb1b9c9 into eclipse-kapua:develop Aug 6, 2024
33 of 34 checks passed
Coduz added a commit that referenced this pull request Aug 26, 2024
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
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