Fix remove bonfire save endpoint

fix completedChallenge saving solution
remove unnecessary code.
This commit is contained in:
Berkeley Martinez
2015-12-08 13:52:03 -08:00
parent 9774638d43
commit 579c569d15
4 changed files with 32 additions and 132 deletions

View File

@ -16,7 +16,7 @@ window.common = (function(global) {
common.challengeName + ', Time: ' + time + ', Attempts: ' + 0
);
var bonfireSolution = common.editor.getValue();
var solution = common.editor.getValue();
var didCompleteWith = $('#completed-with').val() || null;
$('#complete-courseware-dialog').modal('show');
@ -46,23 +46,20 @@ window.common = (function(global) {
next();
});
$.post(
'/completed-bonfire/', {
challengeInfo: {
challengeId: common.challengeId,
challengeName: common.challengeName,
completedWith: didCompleteWith,
challengeType: common.challengeType,
solution: bonfireSolution
}
},
function(res) {
if (res) {
window.location =
'/challenges/next-challenge?id=' + common.challengeId;
}
const data = {
id: common.challengeId,
name: common.challengeName,
completedWith: didCompleteWith,
challengeType: common.challengeType,
solution
};
$.post('/completed-challenge/', data, function(res) {
if (res) {
window.location =
'/challenges/next-challenge?id=' + common.challengeId;
}
);
});
});
};