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