merge: fixed merge conflicts with dev

This commit is contained in:
Adriaan Jacquet 2025-04-22 17:49:11 +02:00
commit faa2f58145
165 changed files with 3948 additions and 3282 deletions

View file

@ -1,6 +1,6 @@
import express from 'express';
import {handleGetFrontendAuthConfig, handleHello} from '../controllers/auth.js';
import {authenticatedOnly, studentsOnly, teachersOnly} from "../middleware/auth/checks/auth-checks";
import { handleGetFrontendAuthConfig, handleHello, postHelloHandler } from '../controllers/auth.js';
import { authenticatedOnly, studentsOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js';
const router = express.Router();
@ -26,4 +26,6 @@ router.get('/testTeachersOnly', teachersOnly, (_req, res) => {
res.json({ message: 'If you see this, you should be a teacher!' });
});
router.post('/hello', authenticatedOnly, postHelloHandler);
export default router;

View file

@ -1,13 +1,12 @@
import express from 'express';
import { createSubmissionHandler, deleteSubmissionHandler, getSubmissionHandler, getSubmissionsHandler } from '../controllers/submissions.js';
import { onlyAllowAuthor } from '../middleware/auth/checks/question-checks.js';
import { onlyAllowIfHasAccessToSubmission, onlyAllowSubmitter } from '../middleware/auth/checks/submission-checks.js';
import { adminOnly, studentsOnly } from '../middleware/auth/checks/auth-checks.js';
const router = express.Router({ mergeParams: true });
router.get('/', adminOnly, getSubmissionsHandler);
router.post('/:id', studentsOnly, onlyAllowSubmitter, createSubmissionHandler);
router.post('/', studentsOnly, onlyAllowSubmitter, createSubmissionHandler);
router.get('/:id', onlyAllowIfHasAccessToSubmission, getSubmissionHandler);

View file

@ -37,6 +37,6 @@ router.get('/:username/joinRequests/:classId', onlyAllowTeacherOfClass, getStude
router.put('/:username/joinRequests/:classId/:studentUsername', onlyAllowTeacherOfClass, updateStudentJoinRequestHandler);
// Invitations to other classes a teacher received
router.get('/invitations', invitationRouter);
router.use('/invitations', invitationRouter);
export default router;