Chore: Remove Dispatch and AddHandler (#42603)

* Remove Dispatch

* Remove context.TODO()

* Remove AddHandler and Dispatch
This commit is contained in:
idafurjes
2021-12-02 18:08:59 +01:00
committed by GitHub
parent e79fe8e84e
commit c80e7764d8
28 changed files with 83 additions and 129 deletions

View File

@@ -13,7 +13,7 @@ func StarDashboard(c *models.ReqContext) response.Response {
return response.Error(400, "Missing dashboard id", nil)
}
if err := bus.Dispatch(&cmd); err != nil {
if err := bus.DispatchCtx(c.Req.Context(), &cmd); err != nil {
return response.Error(500, "Failed to star dashboard", err)
}
@@ -27,7 +27,7 @@ func UnstarDashboard(c *models.ReqContext) response.Response {
return response.Error(400, "Missing dashboard id", nil)
}
if err := bus.Dispatch(&cmd); err != nil {
if err := bus.DispatchCtx(c.Req.Context(), &cmd); err != nil {
return response.Error(500, "Failed to unstar dashboard", err)
}