Skip to content

Commit

Permalink
Update folder json to match as documented (grafana-tools#105)
Browse files Browse the repository at this point in the history
* Update folder json to match as documented

See https://grafana.com/docs/grafana/latest/http_api/folder/#get-all-folders

* fix bug for when dashboards has word "file" in name
  • Loading branch information
jlhags authored Aug 27, 2020
1 parent e6a8cdd commit 68d50b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ type Folder struct {
UID string `json:"uid"`
Title string `json:"title"`
URL string `json:"url"`
HasAcl bool `json:"has_acl"`
CanSave bool `json:"can_save"`
CanEdit bool `json:"can_edit"`
CanAdmin bool `json:"can_admin"`
CreatedBy string `json:"created_by"`
HasAcl bool `json:"hasAcl"`
CanSave bool `json:"canSave"`
CanEdit bool `json:"canEdit"`
CanAdmin bool `json:"canAdmin"`
CreatedBy string `json:"createdBy"`
Created string `json:"created"`
UpdatedBy string `json:"updated_by"`
UpdatedBy string `json:"updatedBy"`
Updated string `json:"updated"`
Version int `json:"version"`
Overwrite bool `json:"overwrite"`
Expand Down
2 changes: 1 addition & 1 deletion rest-dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func setPrefix(slug string) string {
if strings.HasPrefix(slug, "db") {
return slug
}
if strings.HasPrefix(slug, "file") {
if strings.HasPrefix(slug, "file/") {
return slug
}
return fmt.Sprintf("db/%s", slug)
Expand Down

0 comments on commit 68d50b8

Please sign in to comment.