Skip to content

Commit

Permalink
fix: name consistency for "reward"
Browse files Browse the repository at this point in the history
  • Loading branch information
AstatineAi committed Apr 7, 2024
1 parent e8d39cb commit 45c7230
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/models/reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package models

type RanklistResponse struct {
NickName string `json:"nick_name"`
Rewards int `json:"reward"`
Reward int `json:"reward"`
IsAnonymous bool `json:"is_anonymous"`
}
2 changes: 1 addition & 1 deletion pkg/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type User struct {
IsAdmin bool `gorm:"default:false"`
IsCommunityAdmin bool `gorm:"default:false"`
InvitationCode string
Rewards int
Reward int
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/queries/reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func Ranklist(db *gorm.DB) ([]models.RanklistResponse, error) {

var ranklist []models.RanklistResponse
result := db.Model(&models.User{}).
Select("nick_name", "rewards", "is_anonymous").
Select("nick_name", "reward", "is_anonymous").
Order("rewards DESC").
Limit(30).
Scan(&ranklist)
Expand Down

0 comments on commit 45c7230

Please sign in to comment.