pyronear / pyro-api

Alert Management API for wildfire prevention, detection & monitoring. Built with FastAPI & PostgreSQL
Apache License 2.0
21 stars 9 forks source link

feat: add route to retrieve alerts for a given event #268

Closed blenzi closed 1 year ago

blenzi commented 1 year ago

Currently there is a problem for the platform: the list of ongoing alerts is limited to 50 and can fail to retrieve the alerts of an unacknowledged event. This PR adds route /events/{event_id}/alerts and the corresponding method Client.get_alerts_for_event to retrieve the list of alerts for a given event.

ghost commented 1 year ago

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

codecov[bot] commented 1 year ago

Codecov Report

Merging #268 (9e3592b) into main (14f3895) will decrease coverage by 4.91%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##              main     #268      +/-   ##
===========================================
- Coverage   100.00%   95.09%   -4.91%     
===========================================
  Files            3       60      +57     
  Lines           72     1428    +1356     
===========================================
+ Hits            72     1358    +1286     
- Misses           0       70      +70     
Flag Coverage Δ
client 100.00% <100.00%> (ø)
unittests 94.83% <100.00%> (?)

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

Files Changed Coverage Δ
client/pyroclient/client.py 100.00% <100.00%> (ø)
src/app/api/endpoints/events.py 100.00% <100.00%> (ø)

... and 56 files with indirect coverage changes

blenzi commented 1 year ago

/quack review