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

Commit abee6f8

Browse files
add folder uid field into dashboard (#82)
1 parent d77b82f commit abee6f8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

dashboard.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ type DashboardSaveResponse struct {
2828
type Dashboard struct {
2929
Meta DashboardMeta `json:"meta"`
3030
Model map[string]interface{} `json:"dashboard"`
31-
Folder int64 `json:"folderId"`
31+
FolderID int64 `json:"folderId"`
32+
FolderUID string `json:"folderUid"`
3233
Overwrite bool `json:"overwrite"`
3334

3435
// This is only used when creating a new dashboard, it will always be empty when getting a dashboard.
@@ -112,7 +113,7 @@ func (c *Client) dashboard(path string) (*Dashboard, error) {
112113
if err != nil {
113114
return nil, err
114115
}
115-
result.Folder = result.Meta.Folder
116+
result.FolderID = result.Meta.Folder
116117

117118
return result, err
118119
}

dashboard_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ func TestDashboardCreateAndUpdate(t *testing.T) {
5252
Model: map[string]interface{}{
5353
"title": "test",
5454
},
55-
Folder: 0,
55+
FolderID: 0,
56+
FolderUID: "l3KqBxCMz",
5657
Overwrite: false,
5758
}
5859

0 commit comments

Comments
 (0)