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

Folder UID: Wrong field type #148

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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