import express from 'express';

/**
 * Blog Routes
 */
export function createBlogRoutes(blogController) {
  const router = express.Router();

  // Publikus route-ok
  router.get('/', (req, res) => blogController.getAllBlogs(req, res));
  router.get('/:id', (req, res) => blogController.getBlog(req, res));

  // Védett route-ok - FELADAT: add hozzá az auth middleware-t!
  // Példa: router.post('/', authMiddleware, (req, res) => ...)
  router.post('/', (req, res) => blogController.createBlog(req, res));
  router.put('/:id', (req, res) => blogController.updateBlog(req, res));
  router.delete('/:id', (req, res) => blogController.deleteBlog(req, res));

  return router;
}
