more user tests

This commit is contained in:
barisusakli
2017-03-02 21:58:33 +03:00
parent bce1208e2f
commit 4369a6d290
2 changed files with 47 additions and 6 deletions

View File

@@ -39,12 +39,17 @@ userController.getUserByEmail = function (req, res, next) {
};
function byType(type, req, res, next) {
userController.getUserDataByField(req.uid, type, req.params[type], function (err, data) {
if (err || !data) {
return next(err);
async.waterfall([
function (next) {
userController.getUserDataByField(req.uid, type, req.params[type], next);
},
function (data, next) {
if (!data) {
return next();
}
res.json(data);
}
res.json(data);
});
], next);
}
userController.getUserDataByField = function (callerUid, field, fieldValue, callback) {