Chore: Remove bus from alerting rule (#47508)

* Chore: Remove bus from alerting rule

* fix alerting tests

* fix provide service
This commit is contained in:
Serge Zaitsev
2022-04-08 14:30:25 +02:00
committed by GitHub
parent ad432108e6
commit b31c7d3654
11 changed files with 28 additions and 21 deletions
+1 -2
View File
@@ -9,7 +9,6 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/alerting"
"github.com/grafana/grafana/pkg/services/guardian"
@@ -491,7 +490,7 @@ func (hs *HTTPServer) NotificationTest(c *models.ReqContext) response.Response {
SecureSettings: dto.SecureSettings,
}
if err := bus.Dispatch(c.Req.Context(), cmd); err != nil {
if err := hs.AlertNotificationService.HandleNotificationTestCommand(c.Req.Context(), cmd); err != nil {
if errors.Is(err, models.ErrSmtpNotEnabled) {
return response.Error(412, err.Error(), err)
}