Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit 7467880

Browse files
Folder UID: Wrong field type (#148)
Doh!
1 parent 68bdb78 commit 7467880

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

dashboard.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type DashboardMeta struct {
1212
IsStarred bool `json:"isStarred"`
1313
Slug string `json:"slug"`
1414
Folder int64 `json:"folderId"`
15-
FolderUID int64 `json:"folderUid"`
15+
FolderUID string `json:"folderUid"`
1616
URL string `json:"url"`
1717
}
1818

@@ -27,10 +27,12 @@ type DashboardSaveResponse struct {
2727

2828
// Dashboard represents a Grafana dashboard.
2929
type Dashboard struct {
30-
Meta DashboardMeta `json:"meta"`
3130
Model map[string]interface{} `json:"dashboard"`
3231
FolderID int64 `json:"folderId"`
3332

33+
// This field is read-only. It is not used when creating a new dashboard.
34+
Meta DashboardMeta `json:"meta"`
35+
3436
// These fields are only used when creating a new dashboard, they will always be empty when getting a dashboard.
3537
Overwrite bool `json:"overwrite,omitempty"`
3638
Message string `json:"message,omitempty"`

dashboard_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const (
2626
"meta": {
2727
"isStarred": false,
2828
"url": "/d/cIBgcSjkk/production-overview",
29-
"slug": "production-overview"
29+
"slug": "production-overview",
30+
"folderID": 3,
31+
"folderUid": "test"
3032
}
3133
}`
3234

0 commit comments

Comments
 (0)