implemented most of the viewing training reports UI
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user