fix: revert objectification of the id

pull/5362/head
greg linton 2020-01-30 13:41:22 -07:00 committed by Greg
parent 6535a58818
commit 022b845f2c
2 changed files with 8 additions and 6 deletions

View File

@ -600,7 +600,7 @@ func (d *Dashboard) UnmarshalJSON(data []byte) error {
type Alias Dashboard type Alias Dashboard
aux := &struct { aux := &struct {
ID string `json:"id"` ID *string `json:"id,omitempty"`
*Alias *Alias
}{ }{
Alias: (*Alias)(d), Alias: (*Alias)(d),
@ -610,11 +610,13 @@ func (d *Dashboard) UnmarshalJSON(data []byte) error {
return err return err
} }
ID, err := strconv.ParseInt(aux.ID, 10, 64) if aux.ID != nil {
if err != nil { ID, err := strconv.ParseInt(*aux.ID, 10, 64)
return err if err != nil {
return err
}
d.ID = DashboardID(ID)
} }
d.ID = DashboardID(ID)
return nil return nil
} }

View File

@ -608,7 +608,7 @@ const mstp = (state, {params: {dashboardID}}) => {
timeZone, timeZone,
dashboard, dashboard,
fluxLinks: links.flux, fluxLinks: links.flux,
dashboardID: {dashboardID}, dashboardID,
timeRange, timeRange,
refreshRate, refreshRate,
zoomedTimeRange, zoomedTimeRange,