Merge pull request #278 from FreeCodeCamp/accessability

Fix some bugs, improver perf of show all bonfires/challenges and add buttons to challenge views
This commit is contained in:
Berkeley Martinez
2015-03-30 13:12:56 -07:00
11 changed files with 85 additions and 47 deletions

View File

@@ -11,9 +11,12 @@ var _ = require('lodash'),
*/
exports.showAllCoursewares = function(req, res) {
var completedCoursewares = req.user.completedCoursewares.map(function(elem) {
return elem._id;
});
var completedList = [];
if(req.user) {
completedList = req.user.completedList.map(function (elem) {
return elem._id;
});
}
var noDuplicatedCoursewares = R.uniq(completedCoursewares);
var data = {};