From 37f236bf0c6ed49f3c2259b1945bfd602632f352 Mon Sep 17 00:00:00 2001 From: Scott Rice Date: Fri, 6 Feb 2015 16:17:38 -0800 Subject: [PATCH] (#1) Pass number of repos to return for search --- server/api/user/user.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a368cf6..7adc5a6 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -139,9 +139,9 @@ exports.getAnyUserPromise = function(user, username) { }; var changedUsers = []; -var getUsersPromise = function(users, username) { +var getUsersPromise = function(users, username, numberOfRepos) { var promises = users.items.map(function(user) { - return exports.getReposPromise(user, username) + return exports.getReposPromise(user, username, numberOfRepos) .then(function(userPlusRepos) { return exports.getAnyUserPromise(userPlusRepos, username) .then(function(userPlusInfo) { @@ -200,7 +200,7 @@ exports.search = function(req, res, next) { if(!error) { var users = JSON.parse(decodeURIComponent(response.body)); - getUsersPromise(users, req.body.username) + getUsersPromise(users, req.body.username, 3) .then(function() { res.send([changedUsers]); })