2024-09-13 13:03:35 +00:00
|
|
|
import express from "express";
|
2024-10-14 01:23:37 +00:00
|
|
|
import { getClasses, getClassById, getStudentsByClassId, getClassForAdmin, getStudentsWithNoClass, createClass, updateClassById, deleteClassById, updateStudentClassByName } from "../../controllers/monitoringControllers/class.js";
|
2024-10-02 06:11:59 +00:00
|
|
|
import { verifyLoginUser, adminOrTeacherOnly } from "../../middlewares/User/authUser.js";
|
2024-09-13 13:03:35 +00:00
|
|
|
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
|
|
|
|
router.get("/classes", verifyLoginUser, getClasses);
|
|
|
|
|
|
2024-10-14 01:23:37 +00:00
|
|
|
router.get("/class/admin", verifyLoginUser, getClassForAdmin);
|
|
|
|
|
|
2024-09-13 13:03:35 +00:00
|
|
|
router.get("/class/:id", verifyLoginUser, getClassById);
|
|
|
|
|
|
2024-10-02 06:11:59 +00:00
|
|
|
router.get("/class/student/unassigned", verifyLoginUser, adminOrTeacherOnly, getStudentsWithNoClass);
|
|
|
|
|
|
|
|
|
|
router.get("/class/student/:classId", verifyLoginUser, adminOrTeacherOnly, getStudentsByClassId);
|
|
|
|
|
|
2024-09-13 13:03:35 +00:00
|
|
|
router.post("/class", verifyLoginUser, createClass);
|
|
|
|
|
|
2024-10-14 01:23:37 +00:00
|
|
|
router.put("/class/update/:id", verifyLoginUser, updateClassById);
|
2024-09-13 13:03:35 +00:00
|
|
|
|
|
|
|
|
router.delete("/class/delete/:id", verifyLoginUser, deleteClassById);
|
|
|
|
|
|
|
|
|
|
router.post("/class/student/update", verifyLoginUser, updateStudentClassByName);
|
|
|
|
|
|
|
|
|
|
export default router
|