From ee1ee772407e7a8a93d668bc33bf497e8c8a36b9 Mon Sep 17 00:00:00 2001 From: gerard Date: Mon, 16 Jul 2018 14:24:03 +0200 Subject: [PATCH] bug solved --- services/loopback/common/methods/sale/updateQuantity.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/loopback/common/methods/sale/updateQuantity.js b/services/loopback/common/methods/sale/updateQuantity.js index 5fd66866af..1fed144d43 100644 --- a/services/loopback/common/methods/sale/updateQuantity.js +++ b/services/loopback/common/methods/sale/updateQuantity.js @@ -25,7 +25,7 @@ module.exports = Self => { }); Self.updateQuantity = async(id, quantity) => { - if (isNaN(params.editLines[0].discount)) + if (isNaN(quantity)) throw new Error(`The value should be a number`); let currentLine = await Self.app.models.Sale.findOne({where: {id: id}, fields: ['quantity']});