18 lines
626 B
JavaScript
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
|