Skip to content

Commit

Permalink
chore: 🚨 fix houndCI future warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
devdbrandy committed Apr 2, 2019
1 parent 4629cde commit e1e26bd
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 27 deletions.
27 changes: 23 additions & 4 deletions server/routes/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ articles.get(
* schema:
* $ref: '#/definitions/Article'
*/
articles.get('/:slug', articlesMiddleware.validateGetOneArticle, articlesController.getOne);
articles.get(
'/:slug',
articlesMiddleware.validateGetOneArticle,
articlesController.getOne
);

/**
* @swagger
Expand All @@ -117,7 +121,12 @@ articles.get('/:slug', articlesMiddleware.validateGetOneArticle, articlesControl
* schema:
* $ref: '#/definitions/Article'
*/
articles.delete('/:articleId', authenticate, articlesMiddleware.validateDeleteArticle, articlesController.delete);
articles.delete(
'/:articleId',
authenticate,
articlesMiddleware.validateDeleteArticle,
articlesController.delete
);

/**
* @swagger
Expand All @@ -140,7 +149,12 @@ articles.delete('/:articleId', authenticate, articlesMiddleware.validateDeleteAr
* schema:
* $ref: '#/definitions/Article'
*/
articles.put('/:articleId', authenticate, articlesMiddleware.validateUpdateArticle, articlesController.update);
articles.put(
'/:articleId',
authenticate,
articlesMiddleware.validateUpdateArticle,
articlesController.update
);

/**
* @swagger
Expand Down Expand Up @@ -173,7 +187,12 @@ articles.put('/:articleId', authenticate, articlesMiddleware.validateUpdateArtic
* schema:
* $ref: '#/definitions/Article'
*/
articles.post('/', authenticate, articlesMiddleware.validateCreateArticle, articlesMiddleware.validateTagList, articlesController.create);
articles.post(
'/', authenticate,
articlesMiddleware.validateCreateArticle,
articlesMiddleware.validateTagList,
articlesController.create
);

/**
* @swagger
Expand Down
38 changes: 25 additions & 13 deletions server/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ const router = express.Router();
*/

// login user using social authentication
router.get('/facebook',
passport.authenticate('facebook', { scope: ['email'] }));
router.get(
'/facebook',
passport.authenticate('facebook', { scope: ['email'] })
);

router.get('/facebook/redirect',
passport.authenticate('facebook', { failureRedirect: '/' }), authController.socialAuth);
router.get(
'/facebook/redirect',
passport.authenticate('facebook', { failureRedirect: '/' }),
authController.socialAuth
);

/**
* @swagger
Expand All @@ -67,17 +72,21 @@ router.get('/facebook/redirect',
* schema:
* $ref: '#/definitions/User'
*/
router.get('/google',
router.get(
'/google',
passport.authenticate('google', {
scope: [
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'
]
}));
})
);

router.get('/google/redirect',
router.get(
'/google/redirect',
passport.authenticate('google', { failureRedirect: '/' }),
authController.socialAuth);
authController.socialAuth
);

/**
* @swagger
Expand All @@ -94,12 +103,15 @@ router.get('/google/redirect',
* schema:
* $ref: '#/definitions/User'
*/
router.get('/twitter',
passport.authenticate('twitter', { scope: ['include_email=true'] }));
router.get(
'/twitter',
passport.authenticate('twitter', { scope: ['include_email=true'] })
);

router.get('/twitter/redirect',
router.get(
'/twitter/redirect',
passport.authenticate('twitter', { failureRedirect: '/' }),
authController.socialAuth);

authController.socialAuth
);

export default router;
30 changes: 26 additions & 4 deletions server/routes/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ const comments = express.Router();
* schema:
* $ref: '#/definitions/Comments'
*/
comments.post('/:slug/comments/', authenticate, commentsMiddleware.validateCreateCommentInput, commentsController.createComment);
comments.post(
'/:slug/comments/',
authenticate,
commentsMiddleware.validateCreateCommentInput,
commentsController.createComment
);

/**
* @swagger
Expand All @@ -79,7 +84,14 @@ comments.post('/:slug/comments/', authenticate, commentsMiddleware.validateCreat
* schema:
* $ref: '#/definitions/Comments'
*/
comments.get('/:slug/comments/', Validator.validatePaginationLimit(), Handler.handleValidation, commentPagination.validatePagination, commentsMiddleware.validateGetAllComments, commentsController.getAllComments);
comments.get(
'/:slug/comments/',
Validator.validatePaginationLimit(),
Handler.handleValidation,
commentPagination.validatePagination,
commentsMiddleware.validateGetAllComments,
commentsController.getAllComments
);

/**
* @swagger
Expand Down Expand Up @@ -117,7 +129,12 @@ comments.get('/:slug/comments/', Validator.validatePaginationLimit(), Handler.ha
* schema:
* $ref: '#/definitions/Comments'
*/
comments.put('/:slug/comments/:id', authenticate, commentsMiddleware.validateUpdateComment, commentsController.updateComment);
comments.put(
'/:slug/comments/:id',
authenticate,
commentsMiddleware.validateUpdateComment,
commentsController.updateComment
);

/**
* @swagger
Expand Down Expand Up @@ -145,7 +162,12 @@ comments.put('/:slug/comments/:id', authenticate, commentsMiddleware.validateUpd
* schema:
* $ref: '#/definitions/Comments'
*/
comments.delete('/:slug/comments/:id', authenticate, commentsMiddleware.validateDeleteComment, commentsController.deleteComment);
comments.delete(
'/:slug/comments/:id',
authenticate,
commentsMiddleware.validateDeleteComment,
commentsController.deleteComment
);

/**
* @swagger
Expand Down
13 changes: 8 additions & 5 deletions server/routes/reportArticle.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ router.post(
* schema:
* $ref: '#/definitions/Article'
*/
router.get('/:articleId/report',
router.get(
'/:articleId/report',
authenticate,
checkArticle,
reportArticleController.getOneReportedArticle);
reportArticleController.getOneReportedArticle
);

/**
* @swagger
Expand All @@ -91,10 +93,11 @@ router.get('/:articleId/report',
* schema:
* $ref: '#/definitions/Article'
*/

router.get('/reports',
router.get(
'/reports',
authenticate,
checkArticle,
reportArticleController.getAllReportedArticle);
reportArticleController.getAllReportedArticle
);

export default router;
7 changes: 6 additions & 1 deletion server/routes/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ const comments = express.Router();
* schema:
* $ref: '#/definitions/Stats'
*/
comments.get('/:id/stats', authenticate, statsMiddleware.getUserStats, statsController.sendUserStats);
comments.get(
'/:id/stats',
authenticate,
statsMiddleware.getUserStats,
statsController.sendUserStats
);

export default comments;

0 comments on commit e1e26bd

Please sign in to comment.