mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
style(alerting): improve formating
This commit is contained in:
parent
dbf3795aaf
commit
6eca26e8ec
@ -87,10 +87,10 @@ func CreateAlertNotificationCommand(cmd *m.CreateAlertNotificationCommand) error
|
|||||||
|
|
||||||
func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
|
func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
|
||||||
return inTransaction(func(sess *xorm.Session) (err error) {
|
return inTransaction(func(sess *xorm.Session) (err error) {
|
||||||
an := &m.AlertNotification{}
|
alertNotification := &m.AlertNotification{}
|
||||||
|
|
||||||
var has bool
|
var has bool
|
||||||
has, err = sess.Id(cmd.Id).Get(an)
|
has, err = sess.Id(cmd.Id).Get(alertNotification)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -100,18 +100,18 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
|
|||||||
return fmt.Errorf("Alert notification does not exist")
|
return fmt.Errorf("Alert notification does not exist")
|
||||||
}
|
}
|
||||||
|
|
||||||
an.Name = cmd.Name
|
alertNotification.Name = cmd.Name
|
||||||
an.Type = cmd.Type
|
alertNotification.Type = cmd.Type
|
||||||
an.Settings = cmd.Settings
|
alertNotification.Settings = cmd.Settings
|
||||||
an.Updated = time.Now()
|
alertNotification.Updated = time.Now()
|
||||||
|
|
||||||
_, err = sess.Id(an.Id).Cols("name", "type", "settings", "updated").Update(an)
|
_, err = sess.Id(alertNotification.Id).Cols("name", "type", "settings", "updated").Update(alertNotification)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Result = an
|
cmd.Result = alertNotification
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user