api: rename VoteDirection to Direction
This commit is contained in:
parent
fcf21fd9db
commit
0f2a6a8ccc
@ -15,5 +15,5 @@ type comment struct {
|
|||||||
Score int `json:"score"`
|
Score int `json:"score"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
CreationDate time.Time `json:"creationDate"`
|
CreationDate time.Time `json:"creationDate"`
|
||||||
VoteDirection int `json:"voteDirection"`
|
Direction int `json:"direction"`
|
||||||
}
|
}
|
||||||
|
@ -65,9 +65,9 @@ func commentList(commenterHex string, domain string, path string, includeUnappro
|
|||||||
`
|
`
|
||||||
row := db.QueryRow(statement, c.CommentHex, commenterHex)
|
row := db.QueryRow(statement, c.CommentHex, commenterHex)
|
||||||
|
|
||||||
if err = row.Scan(&c.VoteDirection); err != nil {
|
if err = row.Scan(&c.Direction); err != nil {
|
||||||
// TODO: is the only error here that there is no such entry?
|
// TODO: is the only error here that there is no such entry?
|
||||||
c.VoteDirection = 0
|
c.Direction = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ func TestCommentListBasics(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if c[0].VoteDirection != 0 {
|
if c[0].Direction != 0 {
|
||||||
t.Errorf("expected c.VoteDirection = 0 got c.VoteDirection = %d", c[0].VoteDirection)
|
t.Errorf("expected c.Direction = 0 got c.Direction = %d", c[0].Direction)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,8 +47,8 @@ func TestCommentListBasics(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if c[0].VoteDirection != 1 {
|
if c[0].Direction != 1 {
|
||||||
t.Errorf("expected c.VoteDirection = 1 got c.VoteDirection = %d", c[0].VoteDirection)
|
t.Errorf("expected c.Direction = 1 got c.Direction = %d", c[0].Direction)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user