added training report list to client

This commit is contained in:
2025-11-16 22:51:42 -05:00
parent f49988fbaf
commit 631eae4412
5 changed files with 96 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
import { CourseEventDetails, CourseEventSummary } from '@shared/types/course'
//@ts-ignore
const addr = import.meta.env.VITE_APIHOST;
export async function getTrainingReports(): Promise<CourseEventSummary[]> {
const res = await fetch(`${addr}/courseEvent`);
if (res.ok) {
return await res.json() as Promise<CourseEventSummary[]>;
} else {
console.error("Something went wrong");
throw new Error("Failed to load training reports");
}
}