Paired with is now properly saved, bonfire challenge framework is almost ready for release

pull/51/head
Nathan Leniz 2015-01-24 13:40:58 -05:00
parent 4128b3b765
commit 0ca042a1f0
3 changed files with 3 additions and 4 deletions

2
app.js
View File

@ -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 {

View File

@ -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,

View File

@ -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('/');