diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index 7a8be82..f7b92e0 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -1490,7 +1490,7 @@ class PinballViewSet(Base): members = models.Member.objects.all() members = members.annotate( pinball_score=Max('user__scores__score'), - ).exclude(pinball_score__isnull=True).order_by('-pinball_score')[:5] + ).exclude(pinball_score__isnull=True).order_by('-pinball_score') scores = [] @@ -1498,6 +1498,7 @@ class PinballViewSet(Base): scores.append(dict( name=member.preferred_name + ' ' + member.last_name[0], score=member.pinball_score, + member_id=member.id, )) return Response(scores) diff --git a/webclient/src/Display.js b/webclient/src/Display.js index 33fdeb1..92bfdf0 100644 --- a/webclient/src/Display.js +++ b/webclient/src/Display.js @@ -112,7 +112,7 @@ export function DisplayScores(props) { <>
Pinball High Scores
- {scores && scores.map((x, i) => + {scores && scores.slice(0, 5).map((x, i) =>
#{i+1} — {x.name}. {i === 0 ? '👑' : ''}

{x.score.toLocaleString()}