Skip to content

Instantly share code, notes, and snippets.

@moonpatroller
Forked from Grizvok/register.js
Last active May 29, 2017 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moonpatroller/4caf12ef82547567f6d998c8eac9d3e6 to your computer and use it in GitHub Desktop.
Save moonpatroller/4caf12ef82547567f6d998c8eac9d3e6 to your computer and use it in GitHub Desktop.
function doesUserExist() {
pg.connect(conString, function (err, client, done) {
client.query('SELECT user_id FROM clients.users where user_id=$1', [req.body.user], function(err, result) {
if (err) {
console.log('error fetching client from pool', err);
return;
}
doNext(result.rowCount == 1);
});
});
}
function doNext(userExists) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment