feat(targeted): add targeted practice functionality
feat(analytics); add analytics page
This commit is contained in:
@ -7,6 +7,7 @@ import type {
|
||||
SubmitAnswer,
|
||||
} from "../types/session";
|
||||
import type { PracticeSheet } from "../types/sheet";
|
||||
import type { Topic } from "../types/topic";
|
||||
|
||||
const API_URL = "https://ed-dev-api.omukk.dev";
|
||||
|
||||
@ -130,6 +131,29 @@ class ApiClient {
|
||||
);
|
||||
}
|
||||
|
||||
// async startPracticeSession(
|
||||
// token: string,
|
||||
// sessionData: PracticeSessionRequest,
|
||||
// ): Promise<SessionResponse> {
|
||||
// return this.authenticatedRequest<SessionResponse>(`/sessions/`, token, {
|
||||
// method: "POST",
|
||||
// body: JSON.stringify(sessionData),
|
||||
// });
|
||||
// }
|
||||
// async startTargetedPracticeSession(
|
||||
// token: string,
|
||||
// sessionData: TargetedSessionRequest,
|
||||
// ): Promise<TargetedSessionResponse> {
|
||||
// return this.authenticatedRequest<TargetedSessionResponse>(
|
||||
// `/sessions/`,
|
||||
// token,
|
||||
// {
|
||||
// method: "POST",
|
||||
// body: JSON.stringify(sessionData),
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
async startSession(
|
||||
token: string,
|
||||
sessionData: SessionRequest,
|
||||
@ -191,5 +215,12 @@ class ApiClient {
|
||||
async fetchLessonById(token: string, lessonId: string): Promise<Lesson> {
|
||||
return this.authenticatedRequest<Lesson>(`/lessons/${lessonId}`, token);
|
||||
}
|
||||
async fetchAllTopics(token: string): Promise<Topic[]> {
|
||||
return this.authenticatedRequest<Topic[]>(`/topics/`, token);
|
||||
}
|
||||
|
||||
async fetchTopicById(token: string, topicId: string): Promise<Topic> {
|
||||
return this.authenticatedRequest<Topic>(`/topics/${topicId}`, token);
|
||||
}
|
||||
}
|
||||
export const api = new ApiClient(API_URL);
|
||||
|
||||
Reference in New Issue
Block a user