Skip to content

Instantly share code, notes, and snippets.

View Grizvok's full-sized avatar

Trevor Hunka Grizvok

View GitHub Profile
exports.registerUser = async function registerUser(req, res) {
let emailStatus = await checkUserEmail(req.body.email);
if (emailStatus) {
console.log('This is a valid email!');
} else {
console.log('This is not a valid email!');
}
exports.registerUser = async function registerUser(user) {
let emailStatus = await checkUserEmail(user);
if (emailStatus) {
console.log('This is a valid email!');
} else {
console.log('This is not a valid email!');
}
//client-side
$(function() {
var $modal = $('.modal-wrapper');
var $bodypart = $('#bodyselect').val();
var $bodyform = $('.bodyform');
var $measurement = $('.measure').val();
$bodyform.submit(function(event) {
//client-side
$(function() {
var $chest = $('.chest');
var $chestForm = $('.chest-form');
$chest.blur(function() {
$chestForm.submit();
});
$chestForm.submit(function(event) {
event.preventDefault();
router.post('/', function (req, res) {
function repeatedUser() {
req.body.uniqueUser = false;
req.check('uniqueUser', 'That username already exists').equals(false);
var errors = req.validationErrors();
req.session.errors = errors;
req.session.success = false;
res.redirect('/register');
}
function doesUserExist() {
var rowCount;
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);
}
else if (result.rowCount === 1) {
return rowCount = 1;
}