aboutsummaryrefslogtreecommitdiff
path: root/backend/handlers/user.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-07-24 14:40:22 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-07-24 14:40:22 +0300
commitb0d199936b546c75d4b19d99591237f0bf97fe55 (patch)
treee9391880e7db2bd1ea8ff25d91aeea8dd98f186e /backend/handlers/user.go
parentfix/frontend: fixed sidebar title size, removed unnecessary imports (diff)
parentfeat/backend: add newrelic integration (#274) (diff)
downloadlphub-css-overhaul.tar.gz
lphub-css-overhaul.tar.bz2
lphub-css-overhaul.zip
Merge branch 'main' into css-overhaulcss-overhaul
Diffstat (limited to '')
-rw-r--r--backend/handlers/user.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/backend/handlers/user.go b/backend/handlers/user.go
index 53f0d06..ea31065 100644
--- a/backend/handlers/user.go
+++ b/backend/handlers/user.go
@@ -4,6 +4,7 @@ import (
4 "net/http" 4 "net/http"
5 "os" 5 "os"
6 "regexp" 6 "regexp"
7 "sort"
7 "time" 8 "time"
8 9
9 "lphub/database" 10 "lphub/database"
@@ -183,6 +184,15 @@ func Profile(c *gin.Context) {
183 } 184 }
184 } 185 }
185 } 186 }
187 // Sort the overall rankings
188 sort.Slice(rankingsList.Overall, func(i, j int) bool {
189 a := rankingsList.Overall[i]
190 b := rankingsList.Overall[j]
191 if a.TotalScore == b.TotalScore {
192 return a.User.SteamID < b.User.SteamID
193 }
194 return a.TotalScore < b.TotalScore
195 })
186 196
187 placement := 1 197 placement := 1
188 ties := 0 198 ties := 0
@@ -507,6 +517,15 @@ func FetchUser(c *gin.Context) {
507 } 517 }
508 } 518 }
509 } 519 }
520 // Sort the overall rankings
521 sort.Slice(rankingsList.Overall, func(i, j int) bool {
522 a := rankingsList.Overall[i]
523 b := rankingsList.Overall[j]
524 if a.TotalScore == b.TotalScore {
525 return a.User.SteamID < b.User.SteamID
526 }
527 return a.TotalScore < b.TotalScore
528 })
510 529
511 placement := 1 530 placement := 1
512 ties := 0 531 ties := 0