[v9.2.x] Alerting: Use correct response body for silence post API (#57126)

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2022-10-18 11:35:13 -04:00
committed by GitHub
co-authored by Yuriy Tseretyan
parent b9cce07b10
commit 484df7d682
7 changed files with 88 additions and 28 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ import (
"time"
"github.com/go-openapi/strfmt"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
@@ -85,7 +86,9 @@ func (srv AlertmanagerSrv) RouteCreateSilence(c *models.ReqContext, postableSile
return ErrResp(http.StatusInternalServerError, err, "failed to create silence")
}
return response.JSON(http.StatusAccepted, util.DynMap{"message": "silence created", "id": silenceID})
return response.JSON(http.StatusAccepted, apimodels.PostSilencesOKBody{
SilenceID: silenceID,
})
}
func (srv AlertmanagerSrv) RouteDeleteAlertingConfig(c *models.ReqContext) response.Response {