From 3d7c7cf6b3d27f14a0837d7d6b1a2755484394a4 Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sat, 14 Feb 2015 22:42:10 -0500 Subject: [PATCH] Remove debug statements from the server --- controllers/user.js | 2 -- public/js/main.js | 8 +++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/controllers/user.js b/controllers/user.js index 2c4867504f..c7947d53a9 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -193,10 +193,8 @@ 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 2038a91d75..58703f0dbc 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -194,18 +194,16 @@ profileValidation.directive('existingUsername', ['$http', function($http) { require: 'ngModel', link: function (scope, element, attrs, ngModel) { element.bind("keyup", function (event) { - console.log(element.val()); - if ($('#completed-with').val().length > 0) { + if (element.val().length > 0) { ngModel.$setValidity('exists', false); } else { $('#completed-with').removeClass('ng-dirty'); ngModel.$setPristine(); } - if ($('#completed-with').val()) { + if (element.val()) { $http - .get("/api/checkExistingUsername/" + $('#completed-with').val()) + .get("/api/checkExistingUsername/" + element.val()) .success(function (data) { - console.log('Data received from api call is: ', data); ngModel.$setValidity('exists', data); }); }