feat: student send join req

This commit is contained in:
Gabriellvl 2025-03-29 12:21:48 +01:00
parent 70d4c80093
commit 3093a6c131
12 changed files with 347 additions and 169 deletions

View file

@ -0,0 +1,18 @@
import express from "express";
import {
createStudentRequestHandler, deleteClassJoinRequestHandler,
getStudentRequestHandler,
updateClassJoinRequestHandler
} from "../controllers/students";
const router = express.Router({ mergeParams: true });
router.get('/', getStudentRequestHandler);
router.post('/:classId', createStudentRequestHandler);
router.put('/:classId', updateClassJoinRequestHandler);
router.delete('/:classId', deleteClassJoinRequestHandler);
export default router;

View file

@ -10,7 +10,8 @@ import {
getStudentQuestionsHandler,
getStudentSubmissionsHandler,
} from '../controllers/students.js';
import { getStudentGroups } from '../services/students.js';
import joinRequestRouter from './student-join-requests.js'
const router = express.Router();
// Root endpoint used to search objects
@ -38,4 +39,6 @@ router.get('/:username/groups', getStudentGroupsHandler);
// A list of questions a user has created
router.get('/:username/questions', getStudentQuestionsHandler);
router.use('/:username/join-requests', joinRequestRouter)
export default router;