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

Commit 8ef34fa

Browse files
author
Gordon Irving
committed
copy back folder id from meta
1 parent 42c903f commit 8ef34fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dashboard.go

+7
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ import (
66
"errors"
77
"fmt"
88
"io/ioutil"
9+
"log"
10+
"os"
911
)
1012

1113
type DashboardMeta struct {
1214
IsStarred bool `json:"isStarred"`
1315
Slug string `json:"slug"`
16+
Folder int64 `json:"folderId"`
1417
}
1518

1619
type DashboardSaveResponse struct {
@@ -112,6 +115,10 @@ func (c *Client) Dashboard(slug string) (*Dashboard, error) {
112115

113116
result := &Dashboard{}
114117
err = json.Unmarshal(data, &result)
118+
result.Folder = result.Meta.Folder
119+
if os.Getenv("GF_LOG") != "" {
120+
log.Printf("got back dashboard response %s", data)
121+
}
115122
return result, err
116123
}
117124

0 commit comments

Comments
 (0)