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
51
backend/src/routes/students.ts
Normal file
51
backend/src/routes/students.ts
Normal file
|
@ -0,0 +1,51 @@
|
|||
import express from 'express'
|
||||
import {
|
||||
createStudentHandler, deleteStudentHandler,
|
||||
getAllStudentsHandler,
|
||||
getStudentAssignmentsHandler,
|
||||
getStudentClassesHandler,
|
||||
getStudentHandler
|
||||
} from '../controllers/students.js';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
router.get('/', getAllStudentsHandler);
|
||||
|
||||
router.post('/', createStudentHandler);
|
||||
|
||||
router.delete('/:username', deleteStudentHandler);
|
||||
|
||||
// information about a student's profile
|
||||
router.get('/:username', getStudentHandler);
|
||||
|
||||
|
||||
|
||||
// the list of classes a student is in
|
||||
router.get('/:id/classes', getStudentClassesHandler);
|
||||
|
||||
// the list of submissions a student has made
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
res.json({
|
||||
submissions: [ '0' ],
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
// the list of assignments a student has
|
||||
router.get('/:id/assignments', getStudentAssignmentsHandler);
|
||||
|
||||
// the list of groups a student is in
|
||||
router.get('/:id/groups', (req, res) => {
|
||||
res.json({
|
||||
groups: [ '0' ],
|
||||
});
|
||||
})
|
||||
|
||||
// a list of questions a user has created
|
||||
router.get('/:id/questions', (req, res) => {
|
||||
res.json({
|
||||
questions: [ '0' ],
|
||||
});
|
||||
})
|
||||
|
||||
export default router
|
Loading…
Add table
Add a link
Reference in a new issue