backend_adaptive_learning/routes/contents/section.js

19 lines
763 B
JavaScript
Raw Normal View History

2024-09-13 13:03:35 +00:00
import express from "express";
import handleUpload from '../../middlewares/uploadSection.js';
import { getSections, getSectionById, createSection, updateSectionById, deleteSectionById } from "../../controllers/contentControllers/section.js";
import { verifyLoginUser, adminOnly } from "../../middlewares/User/authUser.js";
const router = express.Router();
router.get("/section", verifyLoginUser, getSections);
router.get("/section/:id", verifyLoginUser, getSectionById);
router.post("/section", verifyLoginUser, adminOnly, handleUpload, createSection);
router.put('/section/update/:id', verifyLoginUser, adminOnly, handleUpload, updateSectionById);
router.delete('/section/delete/:id', verifyLoginUser, adminOnly, deleteSectionById);
export default router