diff --git a/api/comment.go b/api/comment.go index d7f4050..b1a23b0 100644 --- a/api/comment.go +++ b/api/comment.go @@ -15,5 +15,5 @@ type comment struct { Score int `json:"score"` State string `json:"state"` CreationDate time.Time `json:"creationDate"` - VoteDirection int `json:"voteDirection"` + Direction int `json:"direction"` } diff --git a/api/comment_list.go b/api/comment_list.go index 73c19ae..1f1ed3f 100644 --- a/api/comment_list.go +++ b/api/comment_list.go @@ -65,9 +65,9 @@ func commentList(commenterHex string, domain string, path string, includeUnappro ` 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? - c.VoteDirection = 0 + c.Direction = 0 } } diff --git a/api/comment_list_test.go b/api/comment_list_test.go index e3ca0f1..2ab83c0 100644 --- a/api/comment_list_test.go +++ b/api/comment_list_test.go @@ -25,8 +25,8 @@ func TestCommentListBasics(t *testing.T) { return } - if c[0].VoteDirection != 0 { - t.Errorf("expected c.VoteDirection = 0 got c.VoteDirection = %d", c[0].VoteDirection) + if c[0].Direction != 0 { + t.Errorf("expected c.Direction = 0 got c.Direction = %d", c[0].Direction) return } @@ -47,8 +47,8 @@ func TestCommentListBasics(t *testing.T) { return } - if c[0].VoteDirection != 1 { - t.Errorf("expected c.VoteDirection = 1 got c.VoteDirection = %d", c[0].VoteDirection) + if c[0].Direction != 1 { + t.Errorf("expected c.Direction = 1 got c.Direction = %d", c[0].Direction) return } }