Skip to content

Commit

Permalink
Fix raw dashboard for proper overwrite.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafov committed Dec 6, 2016
1 parent be992c3 commit e08c352
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ func (r *Instance) SetRawDashboard(raw []byte) error {
code int
err error
buf bytes.Buffer
plain = make(map[string]interface{})
)
if err = json.Unmarshal(raw, &plain); err != nil {
return err
}
plain["id"] = 0
raw, _ = json.Marshal(plain)
buf.WriteString(`{"dashboard":`)
buf.Write(raw)
buf.WriteString(`, "overwrite": true}`)
Expand Down

0 comments on commit e08c352

Please sign in to comment.