Spaces:
Sleeping
Sleeping
| import { apiFetch } from './client' | |
| import type { StudentTopic, StudentSession } from '../types' | |
| export async function getStudentTopics(): Promise<StudentTopic[]> { | |
| const res = await apiFetch('/api/student/topics') | |
| if (!res.ok) { | |
| const err = await res.json() | |
| throw new Error(err.detail ?? 'Failed to load topics') | |
| } | |
| return res.json() | |
| } | |
| export async function getStudentSessions(): Promise<StudentSession[]> { | |
| const res = await apiFetch('/api/student/sessions') | |
| if (!res.ok) throw new Error('Failed to load sessions') | |
| return res.json() | |
| } | |