feat(practice-sheets): add card-based ui for practice sheets

This commit is contained in:
shafin-r
2026-01-11 21:02:35 +06:00
parent c4c300da98
commit 16dffe6ffd
7 changed files with 332 additions and 4 deletions

View File

@ -27,6 +27,25 @@ export interface ApiError {
message?: string;
}
export interface PracticeSheet {
title: string;
subject: string;
difficulty: string;
time_limit: number;
description: string;
topics: string[];
is_locked: boolean;
id: string;
created_at: string;
created_by: {
id: string;
name: string;
email: string;
};
modules: string[];
modules_count: number;
}
class ApiClient {
private baseURL: string;
@ -92,10 +111,23 @@ class ApiClient {
// Example: Get user profile (authenticated endpoint)
async getUserProfile(token: string): Promise<User> {
return this.authenticatedRequest<User>("/auth/me", token);
return this.authenticatedRequest<User>("/auth/me/", token);
}
// Add more API methods here as needed
async getPracticeSheets(
token: string,
page: number,
limit: number
): Promise<any> {
const queryParams = new URLSearchParams({
page: page.toString(),
limit: limit.toString(),
}).toString();
return this.authenticatedRequest<any>(
`/practice-sheets/?${queryParams}`,
token
);
}
}
export const api = new ApiClient(API_URL);