K8s: Dashbaords: Ensure backwards compatibility (#98565)

update-xlsx
Stephanie Hingtgen 4 months ago committed by GitHub
parent c566e6af4e
commit 3797779989
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      pkg/api/dashboard.go

@ -124,6 +124,11 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response
if isEmptyData {
return response.Error(http.StatusInternalServerError, "Error while loading dashboard, dashboard data is invalid", nil)
}
// the dashboard id is no longer set in the spec for unified storage, set it here to keep api compatibility
if dash.Data.Get("id").MustString() == "" {
dash.Data.Set("id", dash.ID)
}
}
guardian, err := guardian.NewByDashboard(ctx, dash, c.SignedInUser.GetOrgID(), c.SignedInUser)
if err != nil {

Loading…
Cancel
Save