added attendees to form
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { CourseAttendee, CourseEventDetails } from "@app/shared/types/course";
|
||||
import { getAllCourses, getCourseEventAttendees, getCourseEventDetails, getCourseEvents, insertCourseEvent } from "../services/CourseSerivce";
|
||||
import { getAllCourses, getCourseEventAttendees, getCourseEventDetails, getCourseEventRoles, getCourseEvents, insertCourseEvent } from "../services/CourseSerivce";
|
||||
import { Request, Response, Router } from "express";
|
||||
|
||||
const courseRouter = Router();
|
||||
@@ -15,6 +15,16 @@ courseRouter.get('/', async (req, res) => {
|
||||
}
|
||||
})
|
||||
|
||||
courseRouter.get('/roles', async (req, res) => {
|
||||
try {
|
||||
const roles = await getCourseEventRoles();
|
||||
res.status(200).json(roles);
|
||||
} catch (err) {
|
||||
console.error('failed to fetch course roles', err);
|
||||
res.status(500).json('failed to fetch course roles\n' + err);
|
||||
}
|
||||
})
|
||||
|
||||
eventRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
let events = await getCourseEvents();
|
||||
|
||||
Reference in New Issue
Block a user