feat: submission endpoint geimplementeerd (ongetest)

This commit is contained in:
Adriaan Jacquet 2025-03-11 18:04:27 +01:00
parent b3299949b0
commit 7c453467df
5 changed files with 85 additions and 10 deletions

View file

@ -4,6 +4,8 @@ import {
getLearningObject,
} from '../controllers/learning-objects.js';
import submissionRoutes from './submissions.js';
const router = express.Router();
// DWENGO learning objects
@ -24,4 +26,6 @@ router.get('/', getAllLearningObjects);
// Example: http://localhost:3000/learningObject/un_ai7
router.get('/:hruid', getLearningObject);
router.use('/:hruid/submissions', submissionRoutes);
export default router;

View file

@ -1,6 +1,9 @@
import express from 'express';
import { getSubmissionHandler } from '../controllers/submissions';
const router = express.Router();
// Root endpoint used to search objects
router.get('/', (req, res) => {
res.json({
@ -9,15 +12,6 @@ router.get('/', (req, res) => {
});
// Information about an submission with id 'id'
router.get('/:id', (req, res) => {
res.json({
id: req.params.id,
student: '0',
group: '0',
time: new Date(2025, 1, 1),
content: 'Wortel 2 is rationeel',
learningObject: '0',
});
});
router.get('/:id', getSubmissionHandler);
export default router;