add score history viewing
Some checks failed
Deploy Backend / docker (ubuntu-latest) (push) Failing after 34s
Deploy Website / docker (ubuntu-latest) (push) Failing after 33s

This commit is contained in:
Lee
2024-10-25 21:29:57 +01:00
parent 9fb5317bc8
commit 97fba47fd8
10 changed files with 417 additions and 112 deletions

View File

@ -52,4 +52,25 @@ export default class ScoresController {
}): Promise<unknown> {
return await ScoreService.getLeaderboardScores(leaderboard, id, page);
}
@Get("/history/:playerId/:leaderboardId/:page", {
config: {},
params: t.Object({
playerId: t.String({ required: true }),
leaderboardId: t.String({ required: true }),
page: t.Number({ required: true }),
}),
})
public async getScoreHistory({
params: { playerId, leaderboardId, page },
}: {
params: {
playerId: string;
leaderboardId: string;
page: number;
};
query: { search?: string };
}): Promise<unknown> {
return (await ScoreService.getPreviousScores(playerId, leaderboardId, page)).toJSON();
}
}