mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
v3 adapt v2: port res.respond, challenge.getMember and challenge.csv
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user