From 0ca042a1f00066596afef990335cfa5f8fc609bb Mon Sep 17 00:00:00 2001 From: Nathan Leniz Date: Sat, 24 Jan 2015 13:40:58 -0500 Subject: [PATCH] Paired with is now properly saved, bonfire challenge framework is almost ready for release --- app.js | 2 +- controllers/bonfire.js | 2 -- public/js/main.js | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 8f572959e53..d15af736844 100644 --- a/app.js +++ b/app.js @@ -310,7 +310,7 @@ app.post('/completed-bonfire/', function (req, res) { }; if (isCompletedWith) { - User.find({"profile.username": isCompletedWith}, function(err, pairedWith) { + User.findOne({"profile.username": isCompletedWith}, function(err, pairedWith) { if (err) { return err; } else { diff --git a/controllers/bonfire.js b/controllers/bonfire.js index 580e47e71fb..866fdc87cba 100644 --- a/controllers/bonfire.js +++ b/controllers/bonfire.js @@ -53,10 +53,8 @@ exports.returnBonfire = function(req, res, next) { Bonfire.find({}, null, { sort: { bonfireNumber: 1 } }, function(err, bonfire) { debug(bonfire[bonfireNumber].challengeEntryPoint); if (err) { - debug('bonfire err: ', err); next(err); } - debug(bonfire[bonfireNumber]._id); res.render('bonfire/show', { completedWith: null, title: bonfire[bonfireNumber].name, diff --git a/public/js/main.js b/public/js/main.js index c817b94a0de..5c8b5c6c3e3 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -71,7 +71,8 @@ $(document).ready(function() { $('.next-bonfire-button').on('click', function() { var bonfireSolution = myCodeMirror.getValue(); var thisBonfireHash = passedBonfireHash || null; - var didCompleteWith = $('#completed-with').text() || null; + var didCompleteWith = $('#completed-with').val() || null; + console.log(didCompleteWith); console.log(bonfireSolution, thisBonfireHash); completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash); l = location.pathname.split('/');