From 1df4893c679f4794ae79090ff3040a5e7de40787 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Mon, 17 Nov 2025 00:21:38 -0500 Subject: [PATCH] implemented most of the viewing training reports UI --- ui/src/api/trainingReport.ts | 11 ++++++ ui/src/pages/TrainingReport.vue | 70 ++++++++++++++++++++++++++++----- 2 files changed, 71 insertions(+), 10 deletions(-) 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 @@