Implement bulk delete endpoints
Some code parts of the dashboard, especially in the calendar, will dispatch hundreds of DELETE
requests, i.e. when removing all future timeslots for a schedule. This is a questionable use of server resources and has a very easy solution: bulk delete requests.
Instead of dispatching multiple DELETE
requests we dispatch a single DELETE
request to the collection endpoint. Every item that is left after filtering the queryset is deleted. This should be quite easy to implement because we can re-use the FilterSet class of the list-operation.
Example for bulk deletion of future timeslots:
DELETE /api/v1/timeslots?scheduleIds=4&startsAfter=2024-03-27T19:00:00Z
This query would delete all timeslots that belong to the schedule with id 4 and are planned to start after March 27, 2024 at 19:00:00 UTC.