andela/codepirates-ah-backend

View on GitHub
src/routes/api/comment/comments.route.js

Summary

Maintainability
A
0 mins
Test Coverage
import express from 'express';
import Comments from '../../../controllers/comments.controller';
import auth from '../../../middlewares/auth';
import CommentsValidation from '../../../middlewares/validators/comments.body';
import confirmEmailAuth from '../../../middlewares/emailVarification.middleware';

const router = express.Router();
router.post('/:slug', [auth, CommentsValidation], Comments.createComment);
router.get('/', [auth], Comments.getComments);
router.delete('/:id', [auth], Comments.deleteComment);
router.put('/:id', [auth, CommentsValidation], Comments.updateComment);
router.get('/like/:id', [auth, confirmEmailAuth], Comments.getLikesComments);
router.post('/like/:id', [auth, confirmEmailAuth], Comments.likeComment);
router.put('/like/:id', [auth, confirmEmailAuth], Comments.updateLikeComment);

export default router;