Skip to content

Commit

Permalink
Don't omit history index when the value is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
dshulyak committed Jul 26, 2019
1 parent dcb0fa5 commit 45895ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions services/browsers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ func TestBrowsersOrderedNewestFirst(t *testing.T) {
Timestamp: 50,
},
{
ID: "3",
Name: "third",
Dapp: true,
Timestamp: 100,
ID: "3",
Name: "third",
Dapp: true,
Timestamp: 100,
HistoryIndex: 0,
History: []string{"zero"},
},
}
for i := 0; i < len(browsers); i++ {
Expand Down
2 changes: 1 addition & 1 deletion services/browsers/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Browser struct {
Name string `json:"name"`
Timestamp uint64 `json:"timestamp"`
Dapp bool `json:"dapp?"`
HistoryIndex int `json:"history-index,omitempty"`
HistoryIndex int `json:"history-index"`
History []string `json:"history,omitempty"`
}

Expand Down

0 comments on commit 45895ef

Please sign in to comment.