Submit simple project (previously known as video challegnes)

This commit is contained in:
Berkeley Martinez
2016-06-08 11:26:33 -07:00
parent c8b0a6cf74
commit d9d049540b
2 changed files with 48 additions and 5 deletions

View File

@@ -68,12 +68,20 @@ module.exports = function(app) {
modernChallengeCompleted
);
// deprecate endpoint
// remove once new endpoint is live
router.post(
'/completed-challenge',
send200toNonUser,
completedChallenge
);
router.post(
'/challenge-completed',
send200toNonUser,
completedChallenge
);
// deprecate endpoint
// remove once new endpoint is live
router.post(
@@ -144,11 +152,7 @@ module.exports = function(app) {
function completedChallenge(req, res, next) {
req.checkBody('id', 'id must be an ObjectId').isMongoId();
req.checkBody('challengeType', 'challengeType must be an integer')
.isNumber();
const type = accepts(req).type('html', 'json', 'text');
const errors = req.validationErrors(true);
if (errors) {