prevent selling negative items (#10061)

This commit is contained in:
negue
2018-02-27 21:51:10 +01:00
committed by Sabe Jones
parent cedfc005f8
commit 0b4eafeb28
4 changed files with 23 additions and 1 deletions

View File

@@ -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));
}