From 08a8f567c4567e81d997239505ce83f53068b3b4 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 29 Apr 2025 10:30:40 +0200 Subject: [PATCH] Send Rang to frontend --- backend/src/Express/Routes/HighScoreRoute.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/Express/Routes/HighScoreRoute.js b/backend/src/Express/Routes/HighScoreRoute.js index cfcf58a..adbb378 100644 --- a/backend/src/Express/Routes/HighScoreRoute.js +++ b/backend/src/Express/Routes/HighScoreRoute.js @@ -24,10 +24,12 @@ class HighScoreRoute { for(const highscore of highscores){ const user1 = await this.db.usermanager.getUser({id: highscore.user1ID}); const user2 = await this.db.usermanager.getUser({id: highscore.user2ID}); + const rang = highscores.indexOf(highscore) + 1; returnJSON.scores.push({ id: highscore.id, score: highscore.score, + rang: rang, user1: { id: user1.id, username: user1.username,