title: res.redirect is not a function in promise then
body: <p>I use node v8.11.1 with express 4.16.3 and postgresql as my database, so I use the <code>pg</code> module. I am new to promises and then. This is my code that should work</p>
  
  <p><strong>the route</strong></p>
  
  <pre><code> router.post('/save',
  (req, res)=&gt;{
    req.checkBody('email', 'put email').notEmpty().trim();
    let errors = req.validationErrors();
    if (errors) {
      req.session.msgs = errors;
      res.redirect('/signup');
     }
     else {
       var user = {email:req.body.email};
       signup.signup(user)
       .then((res)=&gt;{           
         req.session.msgs = [{msg: res}];
         res.redirect('/events');
         },
         (rej)=&gt;{
           res.redirect('/signup');
           req.session.msgs = [{msg: 'err'}];
         }
       )
       .catch((err)=&gt;{
         res.redirect('/signup');
         req.session.msgs = [{msg: 'err'}];
       });
     }
  });
  </code></pre>
  
  <p><strong>the function</strong></p>
  
  <pre><code>const signup = (user) =&gt; {
    return new Promise((res, rej)=&gt;{
      pool.connect( //connect to db
        (err, client, done) =&gt; {
          if (err) {
            return rej(err); //rej
          }
          client.query('insert into user (email) values($1)',[user.email]);
          done();
          res(user.email);
        }// pool anonumous funct
      );//pool connect
    })//promise
  };
  exports.signup = signup;
  </code></pre>
  
  <p>So , I guess this should work right away, but I am getting <code>err TypeError: res.redirect is not a function</code> that refers to my route, in this part</p>
  
  <pre><code>     signup.signup(user)
       .then((res)=&gt;{           
         req.session.msgs = [{msg: res}];
         res.redirect('/events'); // &lt;= REFERS HERE
         },
  </code></pre>
  
  <p>What am I missing? Why is this not a function? How to fix this? Thank you</p>