feat(practice-sheets): add card-based ui for practice sheets
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user