mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Remove Macaron ParamsInt64 function from code base (#43810)
* draft commit * change all calls * Compilation errors
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/datasource"
|
||||
"github.com/grafana/grafana/pkg/api/pluginproxy"
|
||||
@@ -15,6 +16,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/oauthtoken"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/web"
|
||||
)
|
||||
|
||||
func ProvideService(dataSourceCache datasources.CacheService, plugReqValidator models.PluginRequestValidator,
|
||||
@@ -42,7 +44,12 @@ type DataSourceProxyService struct {
|
||||
}
|
||||
|
||||
func (p *DataSourceProxyService) ProxyDataSourceRequest(c *models.ReqContext) {
|
||||
p.ProxyDatasourceRequestWithID(c, c.ParamsInt64(":id"))
|
||||
id, err := strconv.ParseInt(web.Params(c.Req)[":id"], 10, 64)
|
||||
if err != nil {
|
||||
c.JsonApiErr(http.StatusBadRequest, "id is invalid", err)
|
||||
return
|
||||
}
|
||||
p.ProxyDatasourceRequestWithID(c, id)
|
||||
}
|
||||
|
||||
func (p *DataSourceProxyService) ProxyDatasourceRequestWithID(c *models.ReqContext, dsID int64) {
|
||||
|
||||
Reference in New Issue
Block a user