France-ioi / AlgoreaBackend

Backend for the new Algorea platform
MIT License
2 stars 2 forks source link

itemActivityLogForItem & itemActivityLogForAllItems: Add can_watch_item_answer in response: whether the current user can watch the answer #1027

Closed GeoffreyHuck closed 8 months ago

GeoffreyHuck commented 8 months ago

fixes #1025

Added boolean can_watch_item_answer.

Tests have been updated. Since there were already cases where the user can and cannot watch the answer, there is no new test.

I first considered a field item.permissions.can_watch with the value of the permission, but this would have required more work for the implementation. If we only want to know whether or not we can watch the answer, the boolean is simpler.

codecov[bot] commented 8 months ago

Codecov Report

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

Comparison is base (9822520) 100.00% compared to head (994c6b2) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1027 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 233 233 Lines 13975 13983 +8 ========================================= + Hits 13975 13983 +8 ```

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