This commit is contained in:
Ken
2026-01-19 09:33:35 +07:00
parent 374dc12b2d
commit 70838a4bc1
103 changed files with 16929 additions and 2 deletions

30
routes/teacherRoutes.js Normal file
View File

@@ -0,0 +1,30 @@
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;