Files
sena_db_api_layer/routes/teacherRoutes.js
2026-01-19 09:33:35 +07:00

31 lines
868 B
JavaScript

const express = require('express');
const router = express.Router();
const teacherController = require('../controllers/teacherController');
/**
* Teacher Routes
*/
// Get teacher datatypes (must be before /:id route)
router.get('/datatypes/schema', teacherController.getTeacherDatatypes);
// Get all teachers with pagination
router.get('/', teacherController.getAllTeachers);
// Get teacher by ID
router.get('/:id', teacherController.getTeacherById);
// Create new teacher
router.post('/', teacherController.createTeacher);
// Update teacher
router.put('/:id', teacherController.updateTeacher);
// Update teacher profile (separate endpoint for user self-update)
router.put('/:id/profile', teacherController.updateTeacherProfile);
// Delete teacher (update status to resigned)
router.delete('/:id', teacherController.deleteTeacher);
module.exports = router;