Leaderboard View (#332)

* LeaderboardView init

* back scores handling

* blah

* add score controller

* commit score on end of play

* front and back fix

* podium component

* push the button

* ill be baaack

* flex css thing

* pretty

* migration leaderboard

* feat(leaderboard): wip

* feat(leaderboard): pretty

* feat(leaderboard): i might be dumb

* fix(leaderboard): misuse of nullable() for totalScore User validator
This commit is contained in:
Amaury
2023-12-04 23:37:06 +01:00
committed by GitHub
parent dc0c7fa4e7
commit 4ac6369deb
25 changed files with 516 additions and 373 deletions
+21
View File
@@ -733,4 +733,25 @@ export default class API {
public static getPartitionSvgUrl(songId: number): string {
return `${API.baseUrl}/song/${songId}/assets/partition`;
}
public static async updateUserTotalScore(score: number): Promise<void> {
await API.fetch({
route: `/auth/me/score/${score}`,
method: 'PATCH',
});
}
public static getTopTwentyPlayers(): Query<User[]> {
return {
key: ['score'],
exec: () =>
API.fetch(
{
route: '/scores/top/20',
method: 'GET',
},
{ handler: ListHandler(UserHandler) }
),
};
}
}