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
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
}

View File

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