Adding in existing username checking, NOT WORKING AT THE MOMENT

This commit is contained in:
Nathan Leniz
2015-01-24 04:14:41 -05:00
parent a3cf6c3ee2
commit 022b8daddc
4 changed files with 57 additions and 3 deletions

View File

@ -184,6 +184,20 @@ exports.checkUniqueUsername = function(req, res) {
}
});
};
/**
* Existing username check
*/
exports.checkExistingUsername = function(req, res) {
User.count({'profile.username': req.params.username.toLowerCase()}, function (err, data) {
if (data == 1) {
return res.send(false);
} else {
return res.send(true);
}
});
};
/**
* Unique email check API Call
*/