apps/manage-a-book-trading-club/app/controllers/requestsController.js
/*
 * Called with gives and takes in res.locals
 */
Called with gives and takes in res.locals
Called with gives and takes in res . locals
function addRequest(req, res, next) {
  const request = {
    requester: req.user._id,
    gives: res.locals.gives,
    takes: res.locals.takes,
  };
  createRequest(request)
    .then(() => {
      req.flash('info', { success: 'Request successfuly created' });
      res.redirect('/requests');
    })
    .catch(next);
}
function addRequest ( req , res , next ) { const request = { requester : req . user . _id , gives : res . locals . gives , takes : res . locals . takes , } ; createRequest ( request ) . then ( ( ) => { req . flash ( 'info' , { success : 'Request successfuly created' } ) ; res . redirect ( '/requests' ) ; } ) . catch ( next ) ; }
Called with gives and takes in res.locals
Called with gives and takes in res . locals
// eslint-disable-next-line no-underscore-dangle