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

@@ -34,7 +34,7 @@ func OrgRedirect(cfg *setting.Cfg) web.Handler {
}
cmd := models.SetUsingOrgCommand{UserId: ctx.UserId, OrgId: orgId}
if err := bus.Dispatch(&cmd); err != nil {
if err := bus.DispatchCtx(ctx.Req.Context(), &cmd); err != nil {
if ctx.IsApiRequest() {
ctx.JsonApiErr(404, "Not found", nil)
} else {