update
This commit is contained in:
27
routes/studentRoutes.js
Normal file
27
routes/studentRoutes.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const studentController = require('../controllers/studentController');
|
||||
|
||||
/**
|
||||
* Student Routes
|
||||
*/
|
||||
|
||||
// Get student datatypes (must be before /:id route)
|
||||
router.get('/datatypes/schema', studentController.getStudentDatatypes);
|
||||
|
||||
// Get all students with pagination
|
||||
router.get('/', studentController.getAllStudents);
|
||||
|
||||
// Get student by ID
|
||||
router.get('/:id', studentController.getStudentById);
|
||||
|
||||
// Create new student
|
||||
router.post('/', studentController.createStudent);
|
||||
|
||||
// Update student
|
||||
router.put('/:id', studentController.updateStudent);
|
||||
|
||||
// Delete student (update status to dropped)
|
||||
router.delete('/:id', studentController.deleteStudent);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user