implemented most of the viewing training reports UI

This commit is contained in:
2025-11-17 00:21:38 -05:00
parent 1d35fe1cf5
commit 1df4893c67
2 changed files with 71 additions and 10 deletions

View File

@@ -12,4 +12,15 @@ export async function getTrainingReports(): Promise<CourseEventSummary[]> {
console.error("Something went wrong");
throw new Error("Failed to load training reports");
}
}
export async function getTrainingReport(id: number): Promise<CourseEventDetails> {
const res = await fetch(`${addr}/courseEvent/${id}`);
if (res.ok) {
return await res.json() as Promise<CourseEventDetails>;
} else {
console.error("Something went wrong");
throw new Error("Failed to load training reports");
}
}