[dashboard api] manage error when data in dashboard table is not valid json (#29999)
* retrieve dashboard api * Apply suggestions from code review Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/api/dashboard.go Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
co-authored by
Arve Knudsen
parent
db67e70ba4
commit
388d00873f
@@ -1009,7 +1009,9 @@ func TestDashboardAPIEndpoint(t *testing.T) {
|
||||
return nil
|
||||
})
|
||||
bus.AddHandler("test", func(query *models.GetDashboardQuery) error {
|
||||
query.Result = &models.Dashboard{Id: 1, Data: &simplejson.Json{}}
|
||||
dataValue, err := simplejson.NewJson([]byte(`{"id": 1, "editable": true, "style": "dark"}`))
|
||||
require.NoError(t, err)
|
||||
query.Result = &models.Dashboard{Id: 1, Data: dataValue}
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user