backend_adaptive_learning/routes/contents/topic.js

24 lines
916 B
JavaScript
Raw Permalink Normal View History

2024-09-13 13:03:35 +00:00
import express from "express";
import { getTopics, getTopicById, getTopicBySectionId, getTopicForAdmin, createTopic, updateTopicById, deleteTopicById, getCompletedTopicsBySection } from "../../controllers/contentControllers/topic.js";
2024-09-13 13:03:35 +00:00
import { verifyLoginUser, adminOnly } from "../../middlewares/User/authUser.js";
const router = express.Router();
router.get("/topic", verifyLoginUser, getTopics);
router.get("/topic/complete", verifyLoginUser, getCompletedTopicsBySection);
router.get("/topic/admin", verifyLoginUser, getTopicForAdmin);
router.get("/topic/section/:sectionId", verifyLoginUser, getTopicBySectionId);
2024-09-13 13:03:35 +00:00
router.get("/topic/:id", verifyLoginUser, getTopicById);
router.post("/topic", verifyLoginUser, adminOnly, createTopic);
router.put("/topic/:id", verifyLoginUser, adminOnly, updateTopicById);
router.delete("/topic/:id", verifyLoginUser, adminOnly, deleteTopicById);
export default router