HTTP API: GET /api/dashboards/db/:slug response changed property to to match the POST request nameing, Fixes #1928
This commit is contained in:
@@ -46,9 +46,9 @@ func GetDashboard(c *middleware.Context) {
|
||||
}
|
||||
|
||||
dash := query.Result
|
||||
dto := dtos.Dashboard{
|
||||
Model: dash.Data,
|
||||
Meta: dtos.DashboardMeta{IsStarred: isStarred, Slug: slug},
|
||||
dto := dtos.DashboardFullWithMeta{
|
||||
Dashboard: dash.Data,
|
||||
Meta: dtos.DashboardMeta{IsStarred: isStarred, Slug: slug},
|
||||
}
|
||||
|
||||
c.JSON(200, dto)
|
||||
@@ -108,10 +108,10 @@ func GetHomeDashboard(c *middleware.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
dash := dtos.Dashboard{}
|
||||
dash := dtos.DashboardFullWithMeta{}
|
||||
dash.Meta.IsHome = true
|
||||
jsonParser := json.NewDecoder(file)
|
||||
if err := jsonParser.Decode(&dash.Model); err != nil {
|
||||
if err := jsonParser.Decode(&dash.Dashboard); err != nil {
|
||||
c.JsonApiErr(500, "Failed to load home dashboard", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho
|
||||
}
|
||||
|
||||
func GetDashboardSnapshot(c *middleware.Context) {
|
||||
key := c.Params(":key")
|
||||
|
||||
key := c.Params(":key")
|
||||
query := &m.GetDashboardSnapshotQuery{Key: key}
|
||||
|
||||
err := bus.Dispatch(query)
|
||||
@@ -63,8 +63,8 @@ func GetDashboardSnapshot(c *middleware.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
dto := dtos.Dashboard{
|
||||
Model: snapshot.Dashboard,
|
||||
dto := dtos.DashboardFullWithMeta{
|
||||
Dashboard: snapshot.Dashboard,
|
||||
Meta: dtos.DashboardMeta{
|
||||
IsSnapshot: true,
|
||||
Created: snapshot.Created,
|
||||
|
||||
@@ -37,9 +37,9 @@ type DashboardMeta struct {
|
||||
Created time.Time `json:"created"`
|
||||
}
|
||||
|
||||
type Dashboard struct {
|
||||
Meta DashboardMeta `json:"meta"`
|
||||
Model map[string]interface{} `json:"model"`
|
||||
type DashboardFullWithMeta struct {
|
||||
Meta DashboardMeta `json:"meta"`
|
||||
Dashboard map[string]interface{} `json:"dashboard"`
|
||||
}
|
||||
|
||||
type DataSource struct {
|
||||
|
||||
Reference in New Issue
Block a user