Added in debug statements to diagnose problem in production
This commit is contained in:
@ -193,8 +193,10 @@ exports.checkUniqueUsername = function(req, res) {
|
|||||||
exports.checkExistingUsername = function(req, res) {
|
exports.checkExistingUsername = function(req, res) {
|
||||||
User.count({'profile.username': req.params.username.toLowerCase()}, function (err, data) {
|
User.count({'profile.username': req.params.username.toLowerCase()}, function (err, data) {
|
||||||
if (data === 1) {
|
if (data === 1) {
|
||||||
|
debug('Sending back true');
|
||||||
return res.send(true);
|
return res.send(true);
|
||||||
} else {
|
} else {
|
||||||
|
debug('Sending back false');
|
||||||
return res.send(false);
|
return res.send(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -202,6 +202,7 @@ profileValidation.directive('existingUsername', function($http) {
|
|||||||
}
|
}
|
||||||
if (element.val()) {
|
if (element.val()) {
|
||||||
$http.get("/api/checkExistingUsername/" + element.val()).success(function (data) {
|
$http.get("/api/checkExistingUsername/" + element.val()).success(function (data) {
|
||||||
|
console.log('Data received from api call is: ', data);
|
||||||
ngModel.$setValidity('exists', data);
|
ngModel.$setValidity('exists', data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user