added attendees to form

This commit is contained in:
2025-11-19 12:30:33 -05:00
parent 76ec0179b9
commit 403a8b394c
7 changed files with 244 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
import { Course, CourseEventDetails, CourseEventSummary } from '@shared/types/course'
import { Course, CourseAttendeeRole, CourseEventDetails, CourseEventSummary } from '@shared/types/course'
//@ts-ignore
const addr = import.meta.env.VITE_APIHOST;
@@ -29,9 +29,20 @@ export async function getAllTrainings(): Promise<Course[]> {
const res = await fetch(`${addr}/course`);
if (res.ok) {
return await res.json() as Promise<Course[]>;
return await res.json() as Promise<Course[]>;
} else {
console.error("Something went wrong");
throw new Error("Failed to load training list");
}
}
export async function getAllAttendeeRoles(): Promise<CourseAttendeeRole[]> {
const res = await fetch(`${addr}/course/roles`);
if (res.ok) {
return await res.json() as Promise<CourseAttendeeRole[]>;
} else {
console.error("Something went wrong");
throw new Error("Failed to load attendee roles");
}
}