From 68ad6f9831d7fba2b7ef8cc163dae2e37d4381e5 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sat, 14 Feb 2015 21:55:24 -0500 Subject: [PATCH] Added in debug statements to diagnose problem in production --- controllers/user.js | 2 ++ public/js/main.js | 1 + 2 files changed, 3 insertions(+) diff --git a/controllers/user.js b/controllers/user.js index c7947d53a9..2c4867504f 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -193,8 +193,10 @@ exports.checkUniqueUsername = function(req, res) { exports.checkExistingUsername = function(req, res) { User.count({'profile.username': req.params.username.toLowerCase()}, function (err, data) { if (data === 1) { + debug('Sending back true'); return res.send(true); } else { + debug('Sending back false'); return res.send(false); } }); diff --git a/public/js/main.js b/public/js/main.js index 23923bbbaa..039df37d42 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -202,6 +202,7 @@ profileValidation.directive('existingUsername', function($http) { } if (element.val()) { $http.get("/api/checkExistingUsername/" + element.val()).success(function (data) { + console.log('Data received from api call is: ', data); ngModel.$setValidity('exists', data); }); }