MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / Delete

Method Delete

server-source-code/internal/handler/alerts.go:264–275  ·  view source on GitHub ↗

Delete handles DELETE /alerts/:id.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

262
263// Delete handles DELETE /alerts/:id.
264func (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.
278func (h *AlertsHandler) BulkDelete(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

ErrorFunction · 0.85
successDataFunction · 0.85

Tested by

no test coverage detected