add top scores page
Some checks failed
Deploy Backend / docker (ubuntu-latest) (push) Successful in 46s
Deploy Website / docker (ubuntu-latest) (push) Failing after 1m31s

This commit is contained in:
Lee
2024-10-28 13:18:40 +00:00
parent 0a5d42f6ac
commit f52b62ba83
11 changed files with 213 additions and 15 deletions

View File

@ -1,6 +1,7 @@
import { Controller, Get } from "elysia-decorators";
import { t } from "elysia";
import { Leaderboards } from "@ssr/common/leaderboard";
import { TopScoresResponse } from "@ssr/common/response/top-scores-response";
import { ScoreService } from "../service/score.service";
@Controller("/scores")
@ -73,4 +74,14 @@ export default class ScoresController {
}): Promise<unknown> {
return (await ScoreService.getScoreHistory(playerId, leaderboardId, page)).toJSON();
}
@Get("/top", {
config: {},
})
public async getTopScores(): Promise<TopScoresResponse> {
const scores = await ScoreService.getTopScores();
return {
scores,
};
}
}