massenergize / api

Backend Code for Massenergize Portal. This provides the API to the backend database, and is shared by the various front-end portal projects.
MIT License
5 stars 8 forks source link

fix: Sorting logic for listing data #1079

Closed abdullai-t closed 2 months ago

abdullai-t commented 3 months ago

Summary / Highlights

This commit corrects the logic used to sort items based upon provided parameters, changing default sorting direction from "desc" to "asc". Additionally, exception handling has been added in the sorting function to ensure graceful failure and return the original query set in the event of an error.

Details (Give details about what this PR accomplishes, include any screenshots etc)

Testing Steps (Provide details on how your changes can be tested)

Requirements (place an x in each [ ])

Transparency (Project board)
codecov[bot] commented 2 months ago

Codecov Report

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

Project coverage is 55.09%. Comparing base (3472571) to head (2a7c76d).

Files Patch % Lines
src/api/tests/unit/utils/test_filter_functions.py 98.43% 1 Missing :warning:
src/api/utils/filter_functions.py 91.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1079 +/- ## ========================================== + Coverage 54.96% 55.09% +0.12% ========================================== Files 438 439 +1 Lines 32470 32538 +68 ========================================== + Hits 17848 17926 +78 + Misses 14622 14612 -10 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.