pyro-api icon indicating copy to clipboard operation
pyro-api copied to clipboard

feat: add limit and offset parameters to routes that fetch lists from db

Open blenzi opened this issue 2 years ago • 3 comments

This PR adds limit and offset parameters with descriptions, to all routes that fetch lists from db (fix #243, fix #250). Also:

  • use crud.fetch_all in all the routes above, to limit the number of items returned for non-admin users (fix #276)
  • forbid /installation/site-devices to access site outside of group, instead of filtering devices
  • improve test_installations.py (test_get_active_devices_on_site)
  • Dockerfile-dev: update FROM image name

blenzi avatar Aug 07 '23 18:08 blenzi

Nice of you to open a PR :pray: When you're ready and want to get it reviewed, post a comment in this Pull Request with this message: /quack review

ghost avatar Aug 07 '23 18:08 ghost

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.28%. Comparing base (fa2624d) to head (a94ceb9). Report is 62 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #277      +/-   ##
==========================================
+ Coverage   95.12%   95.28%   +0.16%     
==========================================
  Files          63       66       +3     
  Lines        1497     1549      +52     
==========================================
+ Hits         1424     1476      +52     
  Misses         73       73              
Flag Coverage Δ
client 100.00% <ø> (?)
unittests 95.05% <100.00%> (-0.08%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

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

codecov[bot] avatar Aug 07 '23 18:08 codecov[bot]

/quack review

blenzi avatar Aug 07 '23 18:08 blenzi

Closing as this was for the legacy data model, feel free to reopen if I missed something!

frgfm avatar Jan 09 '25 12:01 frgfm