fix(leaderboard): fix leaderboard scheme for questions and streaks

This commit is contained in:
shafin-r
2026-02-22 03:29:01 +06:00
parent a48a50ae77
commit be63ca5ed2
7 changed files with 1454 additions and 1436 deletions

View File

@ -224,8 +224,15 @@ class ApiClient {
return this.authenticatedRequest<Topic>(`/topics/${topicId}`, token);
}
async fetchLeaderboard(token: string): Promise<Leaderboard> {
return this.authenticatedRequest<Leaderboard>(`/leaderboard/`, token);
async fetchLeaderboard(
token: string,
metric: string,
timeframe: string,
): Promise<Leaderboard> {
return this.authenticatedRequest<Leaderboard>(
`/leaderboard/?metric=${metric}&timeframe=${timeframe}`,
token,
);
}
async fetchPredictedScore(token: string): Promise<PredictedScore> {