GetStats handles GET /alerts/stats.
(w http.ResponseWriter, r *http.Request)
| 46 | |
| 47 | // GetStats handles GET /alerts/stats. |
| 48 | func (h *AlertsHandler) GetStats(w http.ResponseWriter, r *http.Request) { |
| 49 | stats, err := h.alerts.GetStats(r.Context()) |
| 50 | if err != nil { |
| 51 | Error(w, http.StatusInternalServerError, "Failed to fetch alert stats") |
| 52 | return |
| 53 | } |
| 54 | successData(w, stats) |
| 55 | } |
| 56 | |
| 57 | // GetAvailableActions handles GET /alerts/actions. |
| 58 | func (h *AlertsHandler) GetAvailableActions(w http.ResponseWriter, r *http.Request) { |
no test coverage detected