feat(alerting): enables deletes for alert notifications
This commit is contained in:
@@ -201,3 +201,16 @@ func UpdateAlertNotification(c *middleware.Context, cmd models.UpdateAlertNotifi
|
||||
|
||||
return Json(200, cmd.Result)
|
||||
}
|
||||
|
||||
func DeleteAlertNotification(c *middleware.Context) Response {
|
||||
cmd := models.DeleteAlertNotificationCommand{
|
||||
OrgId: c.OrgId,
|
||||
Id: c.ParamsInt64("notificationId"),
|
||||
}
|
||||
|
||||
if err := bus.Dispatch(&cmd); err != nil {
|
||||
return ApiError(500, "Failed to delete alert notification", err)
|
||||
}
|
||||
|
||||
return Json(200, map[string]interface{}{"notificationId": cmd.Id})
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ func Register(r *macaron.Macaron) {
|
||||
r.Post("/", bind(m.CreateAlertNotificationCommand{}), wrap(CreateAlertNotification))
|
||||
r.Put("/:notificationId", bind(m.UpdateAlertNotificationCommand{}), wrap(UpdateAlertNotification))
|
||||
r.Get("/:notificationId", wrap(GetAlertNotificationById))
|
||||
r.Delete("/:notificationId", wrap(DeleteAlertNotification))
|
||||
})
|
||||
|
||||
r.Get("/changes", wrap(GetAlertChanges))
|
||||
|
||||
Reference in New Issue
Block a user