server/consume/consume.controller.js
/**
 * Load user and append to req.
 */
Load user and append to req.
Load user and append to req .
function load(req, res, next, id) {
  Consume.findById(id)
    .then((consume) => {
      if (consume) {
        req.consume = consume; 
        return next();
      } else {
        return next(new APIError("Not found", httpStatus.NOT_FOUND))
      }
    })
    .catch(e => next(new APIError("Not found", httpStatus.NOT_FOUND)));
}
function load ( req , res , next , id ) { Consume . findById ( id ) . then ( ( consume ) => { if ( consume ) { req . consume = consume ; return next ( ) ; } else { return next ( new APIError ( "Not found" , httpStatus . NOT_FOUND ) ) } } ) . catch ( e => next ( new APIError ( "Not found" , httpStatus . NOT_FOUND ) ) ) ; }
Load user and append to req.
Load user and append to req .
// eslint-disable-line no-param-reassign