server/server/articles/articles.controller.js
/**
 * Load comment and append to req.
 * @param {object} req.article 	//	loaded article to perform operation
 */
Load comment and append to req.
@param {object} req.article  //      loaded article to perform operation
Load comment and append to req . @param { object } req . article // loaded article to perform operation
function loadComment(req, res, next, id) {
	req.comment = req.article.comments.id(id);
	if (!req.comment) {
		return next(
			new APIError(
				'Comment not found to perform operation',
				httpStatus.BAD_REQUEST,
				true,
			),
		);
	}
	next();
}
function loadComment ( req , res , next , id ) { req . comment = req . article . comments . id ( id ) ; if ( ! req . comment ) { return next ( new APIError ( 'Comment not found to perform operation' , httpStatus . BAD_REQUEST , true , ) , ) ; } next ( ) ; }
Load comment and append to req.
Load comment and append to req .