Show more stats in leaderboard table

This commit is contained in:
notmd
2023-01-24 02:04:00 +07:00
parent 7f993b670c
commit b7056eccd1
13 changed files with 56 additions and 69 deletions
+8 -2
View File
@@ -262,8 +262,14 @@ export class OasstApiClient {
/**
* Returns the current leaderboard ranking.
*/
async fetch_leaderboard(time_frame: LeaderboardTimeFrame): Promise<LeaderboardReply> {
return this.get(`/api/v1/leaderboards/${time_frame}`);
async fetch_leaderboard(
time_frame: LeaderboardTimeFrame,
{ limit = 20 }: { limit?: number }
): Promise<LeaderboardReply> {
const params = new URLSearchParams({
limit: limit.toString(),
});
return this.get(`/api/v1/leaderboards/${time_frame}?${params.toString()}`);
}
/**