course consolidated fixed
This commit is contained in:
@@ -14,7 +14,7 @@ router.get("/consolidated-table", async (req, res) => {
|
||||
const groupedData = {};
|
||||
|
||||
appointments.forEach((appointment) => {
|
||||
const key = `${appointment.facultyId}-${appointment.courseId}`;
|
||||
const key = `${appointment.facultyId}-${appointment.courseId}-${appointment.academicYear}-${appointment.examPeriod}`;
|
||||
if (!groupedData[key]) {
|
||||
groupedData[key] = {
|
||||
facultyId: appointment.facultyId,
|
||||
@@ -36,6 +36,7 @@ router.get("/consolidated-table", async (req, res) => {
|
||||
groupedData[key].tasks.add(appointment.task);
|
||||
});
|
||||
|
||||
|
||||
// Add course details to the grouped data
|
||||
Object.values(groupedData).forEach((data) => {
|
||||
const course = courses.find((c) => c.courseId === data.courseId);
|
||||
|
||||
Reference in New Issue
Block a user