feat(lesson): add lesson modal

This commit is contained in:
shafin-r
2026-02-01 18:20:03 +06:00
parent 62238cbf8f
commit 2ac88835f9
5 changed files with 280 additions and 54 deletions

View File

@ -1,3 +1,4 @@
import type { Lesson, LessonsResponse } from "../types/lesson";
import type {
SessionAnswerResponse,
SessionQuestionsResponse,
@ -183,5 +184,12 @@ class ApiClient {
token,
);
}
async fetchAllLessons(token: string): Promise<LessonsResponse> {
return this.authenticatedRequest<LessonsResponse>(`/lessons/`, token);
}
async fetchLessonById(token: string, lessonId: string): Promise<Lesson> {
return this.authenticatedRequest<Lesson>(`/lessons/${lessonId}`, token);
}
}
export const api = new ApiClient(API_URL);