diff --git a/chronograf.go b/chronograf.go index 329325408..f47d9173b 100644 --- a/chronograf.go +++ b/chronograf.go @@ -600,7 +600,7 @@ func (d *Dashboard) UnmarshalJSON(data []byte) error { type Alias Dashboard aux := &struct { - ID string `json:"id"` + ID *string `json:"id,omitempty"` *Alias }{ Alias: (*Alias)(d), @@ -610,11 +610,13 @@ func (d *Dashboard) UnmarshalJSON(data []byte) error { return err } - ID, err := strconv.ParseInt(aux.ID, 10, 64) - if err != nil { - return err + if aux.ID != nil { + ID, err := strconv.ParseInt(*aux.ID, 10, 64) + if err != nil { + return err + } + d.ID = DashboardID(ID) } - d.ID = DashboardID(ID) return nil } diff --git a/ui/src/dashboards/containers/DashboardPage.tsx b/ui/src/dashboards/containers/DashboardPage.tsx index a80e0450f..f143891c2 100644 --- a/ui/src/dashboards/containers/DashboardPage.tsx +++ b/ui/src/dashboards/containers/DashboardPage.tsx @@ -608,7 +608,7 @@ const mstp = (state, {params: {dashboardID}}) => { timeZone, dashboard, fluxLinks: links.flux, - dashboardID: {dashboardID}, + dashboardID, timeRange, refreshRate, zoomedTimeRange,