mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
prevent selling negative items (#10061)
This commit is contained in:
@@ -17,6 +17,10 @@ module.exports = function sell (user, req = {}) {
|
||||
let type = get(req.params, 'type');
|
||||
let amount = get(req.query, 'amount', 1);
|
||||
|
||||
if (amount < 0) {
|
||||
throw new BadRequest(i18n.t('positiveAmountRequired', req.language));
|
||||
}
|
||||
|
||||
if (!type) {
|
||||
throw new BadRequest(i18n.t('typeRequired', req.language));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user