19 lines
763 B
JavaScript
19 lines
763 B
JavaScript
|
|
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
|