From e7a5e01379304c1aa9f4dbcc57730e3391b414a6 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Fri, 27 Dec 2019 17:27:47 -0800 Subject: [PATCH] comment_vote.go: clean up SQL --- api/comment_vote.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/comment_vote.go b/api/comment_vote.go index 39c930a..6efe203 100644 --- a/api/comment_vote.go +++ b/api/comment_vote.go @@ -28,12 +28,12 @@ func commentVote(commenterHex string, commentHex string, direction int) error { } statement = ` - INSERT INTO - votes (commentHex, commenterHex, direction, voteDate) - VALUES ($1, $2, $3, $4 ) - ON CONFLICT (commentHex, commenterHex) DO - UPDATE SET direction = $3; - ` + INSERT INTO + votes (commentHex, commenterHex, direction, voteDate) + VALUES ($1, $2, $3, $4 ) + ON CONFLICT (commentHex, commenterHex) DO + UPDATE SET direction = $3; + ` _, err := db.Exec(statement, commentHex, commenterHex, direction, time.Now().UTC()) if err != nil { logger.Errorf("error inserting/updating votes: %v", err)