feat: controller en service laag toegevoegd voor student/:id/classes
This commit is contained in:
parent
f5b6a5a604
commit
ceef74f1af
6 changed files with 127 additions and 23 deletions
|
@ -19,7 +19,7 @@ router.get('/:id', (req, res) => {
|
|||
teachers: [ '0' ],
|
||||
students: [ '0' ],
|
||||
joinRequests: [ '0' ],
|
||||
links: {
|
||||
endpoints: {
|
||||
self: `${req.baseUrl}/${req.params.id}`,
|
||||
classes: `${req.baseUrl}/${req.params.id}/invitations`,
|
||||
questions: `${req.baseUrl}/${req.params.id}/assignments`,
|
||||
|
|
|
@ -1,27 +1,15 @@
|
|||
import express from 'express'
|
||||
import { getStudentById } from '../services/students';
|
||||
import { getStudent } from '../controllers/students';
|
||||
import { getAllStudentsHandler, getStudentClassesHandler, getStudentHandler } from '../controllers/students';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
students: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
});
|
||||
});
|
||||
router.get('/', getAllStudentsHandler);
|
||||
|
||||
// information about a student's profile
|
||||
router.get('/:id', getStudent);
|
||||
router.get('/:id', getStudentHandler);
|
||||
|
||||
// the list of classes a student is in
|
||||
router.get('/:id/classes', (req, res) => {
|
||||
res.json({
|
||||
classes: [ '0' ],
|
||||
});
|
||||
})
|
||||
router.get('/:id/classes', getStudentClassesHandler);
|
||||
|
||||
// the list of submissions a student has made
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue