backend_adaptive_learning/routes/contents/topic.js
2024-09-13 20:03:35 +07:00

18 lines
626 B
JavaScript

import express from "express";
import { getTopics, getTopicById, createTopic, updateTopicById, deleteTopicById } 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/: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