Skip to content

Commit

Permalink
Fix TeamPointsEach query
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Mar 22, 2024
1 parent 968cadc commit aef0392
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/db/sql_queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SELECT team_name, SUM(points) AS points
ORDER BY COALESCE(SUM(points), 0) DESC;

-- name: TeamPointsEach :many
SELECT team_name, reason, points
SELECT team_name, reason, SUM(points) AS points
FROM team_points
GROUP BY team_name, reason;

Expand Down
4 changes: 2 additions & 2 deletions server/db/sql_queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/r_leaderboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (s *Server) leaderboard(w http.ResponseWriter, r *http.Request) {
}
table.TeamPoints[ti] = append(table.TeamPoints[ti], teamPoints{
Reason: row.Reason,
Points: row.Points,
Points: row.Points.Float64,
})
}

Expand Down

0 comments on commit aef0392

Please sign in to comment.