Commit 13304682 authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Sort wallet ledger listings by creation time from newest to oldest.

parent b0da36a0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,8 +23,9 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Only perform user account updates if fields have changed.
- Developer console status snapshot gauges more accurately reflect current server metrics.
- Disconnect match participants when an authoritative match ends due to an error.
- Sort wallet ledger listings by creation time from newest to oldest.
- Build with Go 1.14.3 release.
- Update to nakama-common 1.5.0.
- Update to nakama-common 1.5.1.

### Fixed
- Ensure runtime environment values do not appear multiple times in the devconsole configuration view.
+4 −1
Original line number Diff line number Diff line
@@ -264,8 +264,11 @@ func ListWalletLedger(ctx context.Context, logger *zap.Logger, db *sql.DB, userI
	query := "SELECT id, changeset, metadata, create_time, update_time FROM wallet_ledger WHERE user_id = $1::UUID"
	if incomingCursor != nil {
		params = append(params, incomingCursor.CreateTime, incomingCursor.Id)
		query += " AND (user_id, create_time, id) > ($1::UUID, $2, $3::UUID)"
		query += " AND (user_id, create_time, id) < ($1::UUID, $2, $3::UUID)"
	} else {
		query += " AND (user_id, create_time, id) < ($1::UUID, now(), '00000000-0000-0000-0000-000000000000'::UUID)"
	}
	query += " ORDER BY create_time DESC"
	if limit != nil {
		params = append(params, *limit+1)
		query += " LIMIT $" + strconv.Itoa(len(params))