Add Context APIs and refactor vocab models
All checks were successful
Deploy to Production / deploy (push) Successful in 25s
All checks were successful
Deploy to Production / deploy (push) Successful in 25s
Introduce Context and ContextGuide features: add Sequelize models (models/Context.js, models/ContextGuide.js), controllers (controllers/contextController.js, controllers/contextGuideController.js) and authenticated route handlers (routes/contextRoutes.js, routes/contextGuideRoutes.js). Wire the new routes into app.js and export the models from models/index.js. Refactor vocabulary: remove VocabForm, VocabMapping and VocabRelation models and relationships, update models/Vocab.js schema and indexes, and add migrate-vocab.js to drop/recreate the vocab table for the new schema. Also add a lesson editor UI (public/lesson-editor.html) and a small cleanup in models/Lesson.js.
This commit is contained in:
25
routes/contextGuideRoutes.js
Normal file
25
routes/contextGuideRoutes.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const contextGuideController = require('../controllers/contextGuideController');
|
||||
const { authenticateToken } = require('../middleware/auth');
|
||||
|
||||
/**
|
||||
* ContextGuide Routes
|
||||
*/
|
||||
|
||||
// Get all context guides
|
||||
router.get('/', authenticateToken, contextGuideController.getAllContextGuides);
|
||||
|
||||
// Get context guide by UUID
|
||||
router.get('/:id', authenticateToken, contextGuideController.getContextGuideById);
|
||||
|
||||
// Create context guide
|
||||
router.post('/', authenticateToken, contextGuideController.createContextGuide);
|
||||
|
||||
// Update context guide
|
||||
router.put('/:id', authenticateToken, contextGuideController.updateContextGuide);
|
||||
|
||||
// Delete context guide
|
||||
router.delete('/:id', authenticateToken, contextGuideController.deleteContextGuide);
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user