This commit is contained in:
@@ -21,9 +21,6 @@ router.get('/code/:code', categoryController.getCategoryByCode);
|
||||
// GET /api/categories/:id - Get category by ID
|
||||
router.get('/:id', categoryController.getCategoryById);
|
||||
|
||||
// GET /api/categories/:id/subjects - Get subjects by category
|
||||
router.get('/:id/subjects', categoryController.getSubjectsByCategory);
|
||||
|
||||
// POST /api/categories - Create new category
|
||||
router.post('/', categoryController.createCategory);
|
||||
|
||||
@@ -34,6 +31,9 @@ router.put('/:id', categoryController.updateCategory);
|
||||
router.delete('/:id', categoryController.deleteCategory);
|
||||
|
||||
// ============ Nested Subject Routes ============
|
||||
// GET /api/categories/:id/subjects - Get subjects by category
|
||||
router.get('/:id/subjects', categoryController.getSubjectsByCategory);
|
||||
|
||||
// POST /api/categories/:categoryId/subjects - Add subject to category
|
||||
router.post('/:categoryId/subjects', categoryController.addSubjectToCategory);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user