Paired with is now properly saved, bonfire challenge framework is almost ready for release
parent
4128b3b765
commit
0ca042a1f0
2
app.js
2
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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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('/');
|
||||
|
|
Loading…
Reference in New Issue