Adds backend hooks service so extensions can modify index data

This commit is contained in:
Torkel Ödegaard
2018-10-12 11:26:42 +02:00
parent b5e1a8d7be
commit 8c9939df72
6 changed files with 103 additions and 77 deletions
+3 -3
View File
@@ -177,17 +177,17 @@ func UserSetUsingOrg(c *m.ReqContext) Response {
}
// GET /profile/switch-org/:id
func ChangeActiveOrgAndRedirectToHome(c *m.ReqContext) {
func (hs *HTTPServer) ChangeActiveOrgAndRedirectToHome(c *m.ReqContext) {
orgID := c.ParamsInt64(":id")
if !validateUsingOrg(c.UserId, orgID) {
NotFoundHandler(c)
hs.NotFoundHandler(c)
}
cmd := m.SetUsingOrgCommand{UserId: c.UserId, OrgId: orgID}
if err := bus.Dispatch(&cmd); err != nil {
NotFoundHandler(c)
hs.NotFoundHandler(c)
}
c.Redirect(setting.AppSubUrl + "/")