diff --git a/ui/src/api/trainingReport.ts b/ui/src/api/trainingReport.ts index 3cbde6c..c2c57d9 100644 --- a/ui/src/api/trainingReport.ts +++ b/ui/src/api/trainingReport.ts @@ -12,4 +12,15 @@ export async function getTrainingReports(): Promise { 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"); + } } \ No newline at end of file diff --git a/ui/src/pages/TrainingReport.vue b/ui/src/pages/TrainingReport.vue index ab6dec9..15abf3f 100644 --- a/ui/src/pages/TrainingReport.vue +++ b/ui/src/pages/TrainingReport.vue @@ -1,9 +1,9 @@