Chore: fix param names in ctx.ParamsInt64 (#39223)

pull/39239/head
Serge Zaitsev 4 years ago committed by GitHub
parent fdc681788b
commit 6005e6572d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pkg/api/alerting.go
  2. 2
      pkg/api/datasources.go

@ -235,7 +235,7 @@ func getAlertNotificationsInternal(c *models.ReqContext) ([]*models.AlertNotific
func GetAlertNotificationByID(c *models.ReqContext) response.Response {
query := &models.GetAlertNotificationsQuery{
OrgId: c.OrgId,
Id: c.ParamsInt64("notificationId"),
Id: c.ParamsInt64(":notificationId"),
}
if query.Id == 0 {
@ -393,7 +393,7 @@ func fillWithSecureSettingsDataByUID(cmd *models.UpdateAlertNotificationWithUidC
func DeleteAlertNotification(c *models.ReqContext) response.Response {
cmd := models.DeleteAlertNotificationCommand{
OrgId: c.OrgId,
Id: c.ParamsInt64("notificationId"),
Id: c.ParamsInt64(":notificationId"),
}
if err := bus.Dispatch(&cmd); err != nil {
@ -453,7 +453,7 @@ func NotificationTest(c *models.ReqContext, dto dtos.NotificationTestCommand) re
// POST /api/alerts/:alertId/pause
func PauseAlert(c *models.ReqContext, dto dtos.PauseAlertCommand) response.Response {
alertID := c.ParamsInt64("alertId")
alertID := c.ParamsInt64(":alertId")
result := make(map[string]interface{})
result["alertId"] = alertID

@ -430,7 +430,7 @@ func convertModelToDtos(ds *models.DataSource) dtos.DataSource {
// CheckDatasourceHealth sends a health check request to the plugin datasource
// /api/datasource/:id/health
func (hs *HTTPServer) CheckDatasourceHealth(c *models.ReqContext) response.Response {
datasourceID := c.ParamsInt64("id")
datasourceID := c.ParamsInt64(":id")
ds, err := hs.DataSourceCache.GetDatasource(datasourceID, c.SignedInUser, c.SkipCache)
if err != nil {

Loading…
Cancel
Save