feat(leaderboard): add leaderboard functionaltiy

This commit is contained in:
shafin-r
2026-02-07 18:58:50 +06:00
parent 02419678b7
commit c9db96f97f
5 changed files with 221 additions and 60 deletions

View File

@ -1,3 +1,4 @@
import type { Leaderboard } from "../types/leaderboard";
import type { Lesson, LessonsResponse } from "../types/lesson";
import type {
SessionAnswerResponse,
@ -222,5 +223,9 @@ class ApiClient {
async fetchTopicById(token: string, topicId: string): Promise<Topic> {
return this.authenticatedRequest<Topic>(`/topics/${topicId}`, token);
}
async fetchLeaderboard(token: string): Promise<Leaderboard> {
return this.authenticatedRequest<Leaderboard>(`/leaderboard/`, token);
}
}
export const api = new ApiClient(API_URL);