feat(lesson): add lesson modal
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user