Skip to content

Commit

Permalink
backward compatibility for use func GetDashboard without prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
UndeadJoe committed Feb 27, 2020
1 parent 9b3d65d commit 4452e02
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rest-dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (r *Client) GetDashboard(path string) (Board, BoardProperties, error) {
code int
err error
)
//slug, _ = setPrefix(slug)
path, _ = setPrefix(path)
if raw, code, err = r.get(fmt.Sprintf("api/dashboards/%s", path), nil); err != nil {
return Board{}, BoardProperties{}, err
}
Expand Down Expand Up @@ -283,6 +283,9 @@ func setPrefix(slug string) (string, bool) {
if strings.HasPrefix(slug, "file") {
return slug, false
}
if strings.HasPrefix(slug, "uid") {
return slug, false
}
return fmt.Sprintf("db/%s", slug), true
}

Expand Down

0 comments on commit 4452e02

Please sign in to comment.