Skip to content

Commit 4658836

Browse files
committed
More match types leaderboards
1 parent 83bc00a commit 4658836

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

config/config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ db:
55
password: abcd1234
66
schema: kcapp
77
api:
8-
port: 8001
9-
test: abcd1234
8+
port: 8001

data/leaderboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func GetMatchTypeLeaderboard() (map[int][]*models.MatchTypeLeaderboard, error) {
1313
leaderboard := make(map[int][]*models.MatchTypeLeaderboard)
1414
for rows.Next() {
1515
mtl := new(models.MatchTypeLeaderboard)
16-
err := rows.Scan(&mtl.MatchTypeID, &mtl.PlayerID, &mtl.LegID, &mtl.DartsThrown, &mtl.Score)
16+
err := rows.Scan(&mtl.MatchTypeID, &mtl.PlayerID, &mtl.LegID, &mtl.DartsThrown, &mtl.Score, &mtl.ThreeDartAvg)
1717
if err != nil {
1818
return nil, err
1919
}

models/leaderboard.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import "github.com/guregu/null"
44

55
// MatchTypeLeaderboard struct to hold leaderboard data for a specific match type
66
type MatchTypeLeaderboard struct {
7-
MatchTypeID int `json:"match_type_id"`
8-
PlayerID int `json:"player_id"`
9-
LegID int `json:"leg_id"`
10-
DartsThrown null.Int `json:"darts_thrown"`
11-
Score int `json:"score"`
7+
MatchTypeID int `json:"match_type_id"`
8+
PlayerID int `json:"player_id"`
9+
LegID int `json:"leg_id"`
10+
DartsThrown null.Int `json:"darts_thrown"`
11+
Score int `json:"score"`
12+
ThreeDartAvg null.Float `json:"three_dart_avg"`
1213
}

0 commit comments

Comments
 (0)