Alerting: Fix response is not returned for invalid Duration in Provisioning API (#58046) (#58049)

(cherry picked from commit 4c581b5f85)

Co-authored-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2022-11-02 13:06:58 +00:00
committed by GitHub
co-authored by George Robinson
parent 844b08962d
commit 5895100beb
+1 -1
View File
@@ -257,7 +257,7 @@ func (srv *ProvisioningSrv) RoutePostAlertRule(c *models.ReqContext, ar definiti
upstreamModel, err := ar.UpstreamModel()
upstreamModel.OrgID = c.OrgID
if err != nil {
ErrResp(http.StatusBadRequest, err, "")
return ErrResp(http.StatusBadRequest, err, "")
}
createdAlertRule, err := srv.alertRules.CreateAlertRule(c.Req.Context(), upstreamModel, alerting_models.ProvenanceAPI, c.UserID)
if errors.Is(err, alerting_models.ErrAlertRuleFailedValidation) {