Delete handles DELETE /alerts/:id.
(w http.ResponseWriter, r *http.Request)
| 262 | |
| 263 | // Delete handles DELETE /alerts/:id. |
| 264 | func (h *AlertsHandler) Delete(w http.ResponseWriter, r *http.Request) { |
| 265 | id := chi.URLParam(r, "id") |
| 266 | if id == "" { |
| 267 | Error(w, http.StatusBadRequest, "Alert ID required") |
| 268 | return |
| 269 | } |
| 270 | if err := h.alerts.Delete(r.Context(), id); err != nil { |
| 271 | Error(w, http.StatusInternalServerError, "Failed to delete alert") |
| 272 | return |
| 273 | } |
| 274 | successData(w, map[string]interface{}{"deleted": true}) |
| 275 | } |
| 276 | |
| 277 | // BulkDelete handles POST /alerts/bulk-delete. |
| 278 | func (h *AlertsHandler) BulkDelete(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected