From 069a566d40dfce560cdd60cdff814f056b12a982 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 29 Oct 2024 18:45:34 +0000 Subject: [PATCH] add additional data and previous score in top scores response --- projects/backend/src/service/score.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/backend/src/service/score.service.ts b/projects/backend/src/service/score.service.ts index 5f85de0..0622bce 100644 --- a/projects/backend/src/service/score.service.ts +++ b/projects/backend/src/service/score.service.ts @@ -373,6 +373,11 @@ export class ScoreService { score.additionalData = additionalData; } + const previousScore = await this.getPreviousScore(score.playerId, leaderboard.id + "", score.timestamp); + if (previousScore) { + score.previousScore = previousScore; + } + scores.push({ score: score, leaderboard: leaderboard,