//----------------------------------------------------------------------------//
var express = require('express');
var router = express.Router();
var pg = require('pg');
var connectionString = require('../modules/db-config.module');
//----------------------------------------------------------------------------//

// Gets a user's profile info and FAQ entries
router.get('/:id', function(req, res) {
  var userId = req.params.id;

  pg.connect(connectionString, function(error, client, done) {
    connectionErrorCheck(error);

    client.query(
      'SELECT * FROM mentors ' +
      'JOIN faq ON mentors.id = faq.mentor_id ' +
      'WHERE mentors.id = $1', [userId],
      function(error, result) {
        if(error) {
          console.log('Error when searching mentors and FAQ tables: ', error);
          res.sendStatus(500);
        } else {
          res.send(result.rows);
        }
      }
    );
  });
});

module.exports = router;

// Checks for errors connecting to the database
function connectionErrorCheck(error) {
  if (error) {
    console.log('Database connection error: ', error);
    res.sendStatus(500);
  }
}

@@ -580,16 +580,27 @@
 %0A      '
+FULL OUTER 
 JOIN faq
@@ -703,24 +703,40 @@
 , result) %7B%0A
+        done();%0A
         if(e

Fix issue with pulling users with FAQs