From 89d0779751d105da9df2af4c7ce339a9287319e5 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Tue, 6 Jan 2015 23:42:27 +0000 Subject: [PATCH] Fix recents for services object --- app.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app.js b/app.js index 8ee1f3b..9bc11cc 100644 --- a/app.js +++ b/app.js @@ -84,12 +84,7 @@ app.get('/recent', function(req, res, next) { req.db.matches.find().sort({created_at:-1}).limit(6).toArray().then(function(docs){ var recents = []; docs.forEach(function(doc) { - doc.services.some(function(item) { - if (item.service == doc._id.split("$$")[0]) { - recents.push(item); - return false; - } - }); + recents.push(doc.services[doc._id.split("$$")[0]]) }); res.json({recents:recents}); }).catch(function (error) {