import express from "express";
import {
	createNews,
	getAllNews,
	getNewsById,
	updateNews,
	deleteNews,
} from "../controllers/newsMedia.controller.js";

import jwtAuthMiddleware from "../middleware/auth.js";

const router = express.Router();

// PUBLIC ROUTES
router.get("/getAll", getAllNews);
router.get("/:id", getNewsById);

// PROTECTED ROUTES
router.post("/", jwtAuthMiddleware, createNews);
router.patch("/:id", jwtAuthMiddleware, updateNews);
router.delete("/:id", jwtAuthMiddleware, deleteNews);

export default router;
