import express from "express";
import { getTopics, getTopicById, getTopicBySectionId, getTopicForAdmin, createTopic, updateTopicById, deleteTopicById, getCompletedTopicsBySection } from "../../controllers/contentControllers/topic.js";
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);

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