Move bell requests to REST
Part of #798 (closed), can help with #935 (closed)
What does this MR do?
Moves all XHR requests for bells to nre REST endpoints:
-
GET /api/bells
returns the bell list for the infobar (with pagination) -
DELETE /api/bells/{id}
deletes a bell -
PATCH /api/bells
marks a list of bells as read
How confident are you it won't break things if deployed?
Quite sure, seems to work. I added unit tests.
How to test
Create some bells, e.g.:
- Login as user2
- Go to the map
- Select a store and click "I would like to help" -> this creates a bell for userbot
Test the bells:
- Login as userbot
- See if the unread bell appears in the infobar
- Click on the bell -> you will be redirected
- The bell should now be marked as read
- Delete the bell
- Reload the page -> the bell should be gone
Checklist
-
added a test, or explain why one is not needed/possible... -
no unrelated changes -
asked someone for a code review -
set a "for:" label to indicate who will be affected by this change -
use "state:" labels to track this MR's state until it was beta tested -
added an entry to CHANGELOG.md -
add a short text that can be used in the release notes -
Once your MR has been merged, you are responsible to create a testing issue in Beta Testing Repo: - Consider writing a detailed description in German.
- Describe in a few sentences, what should be tested from a user perspective.
- Also mention different settings (e.g. different browsers, roles, ...). how this change can be tested.
- Be aware, that also non technical people should understand.
Edited by Alex