import express from "express";
import * as ctrl from "../controllers/blogs.controller.js";

const router = express.Router();

router.get("/", ctrl.list);
router.get("/category/:category", ctrl.getByCategory);
router.get("/:id", ctrl.getById);
router.post("/", ctrl.create);
// Specific routes must come before generic ones
router.put("/category/:category/hero", ctrl.updateHeroSection);
router.put("/category/:category/component/:componentId", ctrl.updateComponent);
router.put("/category/:category", ctrl.updateByCategory);
router.put("/:id", ctrl.update);
router.delete("/:id", ctrl.remove);

export default router;

