Skip to content

Commit

Permalink
[extapi] fixed votes returning associated bgg_id
Browse files Browse the repository at this point in the history
  • Loading branch information
DictumMortuum committed Dec 14, 2024
1 parent 634a0dc commit ccf76ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/servus-extapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func Version(c *gin.Context) {
rs := map[string]any{
"version": "v0.0.36",
"version": "v0.0.37",
}
c.AbortWithStatusJSON(200, rs)
}
Expand Down
8 changes: 5 additions & 3 deletions pkg/model/eurovisionvotes.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ func GetEurovisionVotes(req *Map, res *Map) error {
}

type temp_res struct {
Flag string `json:"flag"`
Name string `json:"name"`
Votes int `json:"votes"`
Flag string `json:"flag"`
Name string `json:"name"`
Votes int `json:"votes"`
BoardgameId int64 `json:"boardgame_id"`
}

votes := []int{12, 10, 8, 7, 6, 5, 4, 3, 2, 1}
Expand All @@ -155,6 +156,7 @@ func GetEurovisionVotes(req *Map, res *Map) error {
tmp := result[item.Boardgame.Name]
tmp.Name = item.Boardgame.Name
tmp.Flag = item.Boardgame.Square200
tmp.BoardgameId = item.Boardgame.Id

if i < len(votes) && i >= 0 {
tmp.Votes += votes[i]
Expand Down

0 comments on commit ccf76ef

Please sign in to comment.