const express = require('express');
const router = express.Router();
const faqController = require('../controllers/faqController');
const { protect } = require('../middleware/authMiddleware');

// Public routes
router.get('/public', faqController.getAllFAQs);

// Admin routes (require authentication)
router.get('/', protect, faqController.getAdminFAQs);
router.get('/:id', protect, faqController.getFAQById);
router.post('/', protect, faqController.createFAQ);
router.put('/:id', protect, faqController.updateFAQ);
router.delete('/:id', protect, faqController.deleteFAQ);

module.exports = router;
