Merge branch 'feat/service-layer' into feat/service-layer-adriaan
# Conflicts: # backend/src/controllers/classes.ts # backend/src/controllers/students.ts # backend/src/data/users/teacher-repository.ts # backend/src/interfaces/assignment.ts # backend/src/interfaces/teacher.ts # backend/src/routes/classes.ts # backend/src/services/assignments.ts # backend/src/services/class.ts # backend/src/services/students.ts # backend/src/util/translation-helper.ts
This commit is contained in:
commit
6c4ea0eefb
33 changed files with 454 additions and 137 deletions
31
backend/src/routes/assignments.ts
Normal file
31
backend/src/routes/assignments.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import express from 'express'
|
||||
import { getAllAssignmentsHandler, getAssignmentHandler } from '../controllers/assignments.js';
|
||||
import groupRouter from './group.js';
|
||||
|
||||
const router = express.Router({ mergeParams: true });
|
||||
|
||||
// root endpoint used to search objects
|
||||
router.get('/', getAllAssignmentsHandler);
|
||||
|
||||
// information about an assignment with id 'id'
|
||||
router.get('/:id', getAssignmentHandler);
|
||||
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
res.json({
|
||||
submissions: [
|
||||
'0'
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/:id/questions', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0'
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
router.use('/:assignmentid/groups', groupRouter);
|
||||
|
||||
export default router
|
Loading…
Add table
Add a link
Reference in a new issue