Skip to content

Commit

Permalink
Correctly filter purchases in console account view. (#1273)
Browse files Browse the repository at this point in the history
Only display purchases owned by the account being viewed.
  • Loading branch information
sesposito authored Oct 8, 2024
1 parent 6cbe036 commit b0615f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
### Fixed
- Ensure matchmaker stats behave correctly if matchmaker becomes fully empty and idle.
- Correctly clear rank cache entries on account deletion.
- Only display owned purchases in the console account tab.

## [3.23.0] - 2024-07-27
### Added
Expand Down
7 changes: 6 additions & 1 deletion server/core_purchase.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,12 @@ LIMIT $4`
}
params = append(params, incomingCursor.PurchaseTime.AsTime(), incomingCursor.UserId, incomingCursor.TransactionId)
} else {
query += " ORDER BY purchase_time DESC, user_id DESC, transaction_id DESC LIMIT $1"
if userID == "" {
query += " ORDER BY purchase_time DESC, user_id DESC, transaction_id DESC LIMIT $1"
} else {
query += " WHERE user_id = $1 ORDER BY purchase_time DESC, user_id DESC, transaction_id DESC LIMIT $2"
params = append(params, userID)
}
}

if limit > 0 {
Expand Down

0 comments on commit b0615f4

Please sign in to comment.