Remove debug statements from the server

This commit is contained in:
Nathan Leniz
2015-02-14 22:42:10 -05:00
parent 284b8e03ff
commit 3d7c7cf6b3
2 changed files with 3 additions and 7 deletions

View File

@ -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);
}
});

View File

@ -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);
});
}