middleware: rename org-id -> orgId

This commit is contained in:
bergquist 2017-02-17 15:18:40 +01:00
parent 5174d050f2
commit 6115941df0
3 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ import (
func OrgRedirect() macaron.Handler {
return func(res http.ResponseWriter, req *http.Request, c *macaron.Context) {
orgId := c.QueryInt64("org-id")
orgId := c.QueryInt64("orgId")
if orgId == 0 {
return
}

View File

@ -28,7 +28,7 @@ func TestOrgRedirectMiddleware(t *testing.T) {
})
sc.m.Get("/", sc.defaultHandler)
sc.fakeReq("GET", "/?org-id=3").exec()
sc.fakeReq("GET", "/?orgId=3").exec()
Convey("change org and redirect", func() {
So(sc.resp.Code, ShouldEqual, 302)
@ -50,7 +50,7 @@ func TestOrgRedirectMiddleware(t *testing.T) {
})
sc.m.Get("/", sc.defaultHandler)
sc.fakeReq("GET", "/?org-id=3").exec()
sc.fakeReq("GET", "/?orgId=3").exec()
Convey("not allowed to change org", func() {
So(sc.resp.Code, ShouldEqual, 404)

View File

@ -113,7 +113,7 @@ func (c *EvalContext) GetRuleUrl() (string, error) {
if slug, err := c.GetDashboardSlug(); err != nil {
return "", err
} else {
ruleUrl := fmt.Sprintf("%sdashboard/db/%s?fullscreen&edit&tab=alert&panelId=%d&org-id=%d", setting.AppUrl, slug, c.Rule.PanelId, c.Rule.OrgId)
ruleUrl := fmt.Sprintf("%sdashboard/db/%s?fullscreen&edit&tab=alert&panelId=%d&orgId=%d", setting.AppUrl, slug, c.Rule.PanelId, c.Rule.OrgId)
return ruleUrl, nil
}
}