Chore: Use context.Context for the get home dashboard API endpoint (#36735)
Use context.Context for the get home dashboard API endpoint. Ref #36734
This commit is contained in:
@@ -423,7 +423,7 @@ func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) response.Response {
|
||||
prefsQuery := models.GetPreferencesWithDefaultsQuery{User: c.SignedInUser}
|
||||
homePage := hs.Cfg.HomePage
|
||||
|
||||
if err := hs.Bus.Dispatch(&prefsQuery); err != nil {
|
||||
if err := hs.Bus.DispatchCtx(c.Req.Context(), &prefsQuery); err != nil {
|
||||
return response.Error(500, "Failed to get preferences", err)
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) response.Response {
|
||||
|
||||
if prefsQuery.Result.HomeDashboardId != 0 {
|
||||
slugQuery := models.GetDashboardRefByIdQuery{Id: prefsQuery.Result.HomeDashboardId}
|
||||
err := hs.Bus.Dispatch(&slugQuery)
|
||||
err := hs.Bus.DispatchCtx(c.Req.Context(), &slugQuery)
|
||||
if err == nil {
|
||||
url := models.GetDashboardUrl(slugQuery.Result.Uid, slugQuery.Result.Slug)
|
||||
dashRedirect := dtos.DashboardRedirect{RedirectUri: url}
|
||||
|
||||
Reference in New Issue
Block a user