import { Router } from 'express';
import forumController from '../controllers/forumController.js';
import { authenticate } from '../middleware/authMiddleware.js';

const forumRouter = Router();

forumRouter.use(authenticate);

forumRouter.post('/topic/:id/message', forumController.addMessage);
forumRouter.post('/topic', forumController.createTopic);
forumRouter.get('/topic/:id', forumController.getTopic);
forumRouter.post('/', forumController.createForum);
forumRouter.delete('/:forumId', forumController.deleteForum);
forumRouter.get('/:forumId/:page', forumController.getForum);
forumRouter.get('/', forumController.getAllForums);

export default forumRouter;
