v3 adapt v2: port res.respond, challenge.getMember and challenge.csv

This commit is contained in:
Matteo Pagliazzi
2016-04-09 17:16:00 +02:00
parent 6b2d1a1416
commit aa8fb81b26
3 changed files with 31 additions and 81 deletions

View File

@@ -871,13 +871,9 @@ _.each(shared.ops, function(op,k){
if (k === 'reroll') k = 'userReroll';
// if (k === 'reset') k = 'resetUser';
api[k] = async function (req, res, next) {
try {
req.v2 = true;
await v3UserController[k](req, res, next);
} catch (err) {
next(err);
}
api[k] = function (req, res, next) {
req.v2 = true;
v3UserController[k].handler(req, res, next).catch(next);
}
} else if (!api[k]) {
api[k] = function(req, res, next) {