feat: service en controller laag voor getStudent geimplementeerd
This commit is contained in:
parent
8c22b72b22
commit
f5b6a5a604
5 changed files with 459 additions and 2917 deletions
|
@ -1,4 +1,6 @@
|
|||
import express from 'express'
|
||||
import { getStudentById } from '../services/students';
|
||||
import { getStudent } from '../controllers/students';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
|
@ -12,20 +14,7 @@ router.get('/', (req, res) => {
|
|||
});
|
||||
|
||||
// information about a student's profile
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
firstName: 'Jimmy',
|
||||
lastName: 'Faster',
|
||||
username: 'JimmyFaster2',
|
||||
endpoints: {
|
||||
classes: `/student/${req.params.id}/classes`,
|
||||
questions: `/student/${req.params.id}/submissions`,
|
||||
invitations: `/student/${req.params.id}/assignments`,
|
||||
groups: `/student/${req.params.id}/groups`,
|
||||
},
|
||||
});
|
||||
});
|
||||
router.get('/:id', getStudent);
|
||||
|
||||
// the list of classes a student is in
|
||||
router.get('/:id/classes', (req, res) => {
|
||||
|
@ -56,4 +45,11 @@ router.get('/:id/groups', (req, res) => {
|
|||
});
|
||||
})
|
||||
|
||||
// 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