mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
res.respond: allow for thrid parameter (message), refactor shared ops responses and adapt tests
This commit is contained in:
@@ -57,14 +57,12 @@ module.exports = function releaseBoth (user, req = {}, analytics) {
|
||||
user.achievements.triadBingoCount++;
|
||||
}
|
||||
|
||||
let response = {
|
||||
data: _.pick(user, splitWhitespace('achievements')),
|
||||
message: i18n.t('mountsAndPetsReleased'),
|
||||
};
|
||||
|
||||
if (req.v2 === true) {
|
||||
return user;
|
||||
} else {
|
||||
return response;
|
||||
return [
|
||||
_.pick(user, splitWhitespace('achievements items balance')),
|
||||
i18n.t('mountsAndPetsReleased'),
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user