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

Commit

Permalink
Folder UID: Wrong field type (#148)
Browse files Browse the repository at this point in the history
Doh!
  • Loading branch information
julienduchesne authored Apr 27, 2023
1 parent 68bdb78 commit 7467880
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type DashboardMeta struct {
IsStarred bool `json:"isStarred"`
Slug string `json:"slug"`
Folder int64 `json:"folderId"`
FolderUID int64 `json:"folderUid"`
FolderUID string `json:"folderUid"`
URL string `json:"url"`
}

Expand All @@ -27,10 +27,12 @@ type DashboardSaveResponse struct {

// Dashboard represents a Grafana dashboard.
type Dashboard struct {
Meta DashboardMeta `json:"meta"`
Model map[string]interface{} `json:"dashboard"`
FolderID int64 `json:"folderId"`

// This field is read-only. It is not used when creating a new dashboard.
Meta DashboardMeta `json:"meta"`

// These fields are only used when creating a new dashboard, they will always be empty when getting a dashboard.
Overwrite bool `json:"overwrite,omitempty"`
Message string `json:"message,omitempty"`
Expand Down
4 changes: 3 additions & 1 deletion dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const (
"meta": {
"isStarred": false,
"url": "/d/cIBgcSjkk/production-overview",
"slug": "production-overview"
"slug": "production-overview",
"folderID": 3,
"folderUid": "test"
}
}`

Expand Down

0 comments on commit 7467880

Please sign in to comment.