feat(alerting): enables deletes for alert notifications

This commit is contained in:
bergquist
2016-06-16 15:21:44 +02:00
parent 149c2ae913
commit b907ce341c
7 changed files with 64 additions and 11 deletions

View File

@@ -15,6 +15,20 @@ func init() {
bus.AddHandler("sql", AlertNotificationQuery)
bus.AddHandler("sql", CreateAlertNotificationCommand)
bus.AddHandler("sql", UpdateAlertNotification)
bus.AddHandler("sql", DeleteAlertNotification)
}
func DeleteAlertNotification(cmd *m.DeleteAlertNotificationCommand) error {
return inTransaction(func(sess *xorm.Session) error {
sql := "DELETE FROM alert_notification WHERE alert_notification.org_id = ? AND alert_notification.id = ?"
_, err := sess.Exec(sql, cmd.OrgId, cmd.Id)
if err != nil {
return err
}
return nil
})
}
func AlertNotificationQuery(query *m.GetAlertNotificationQuery) error {