feat(alerting): enables deletes for alert notifications
This commit is contained in:
1 parent
149c2ae913
commit
b907ce341c
7 files changed
+64
-11
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user