From a09d88684e8eb2ae9eaf6ddd14348bd7babdc94c Mon Sep 17 00:00:00 2001 From: dbroqua Date: Wed, 10 Oct 2018 21:14:38 +0200 Subject: [PATCH] Fixed bug --- middleware/Vegetables.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/middleware/Vegetables.js b/middleware/Vegetables.js index 9b4a338..4cd6d50 100644 --- a/middleware/Vegetables.js +++ b/middleware/Vegetables.js @@ -40,24 +40,24 @@ class Vegetables { if (properties.count === saved) { callback(null, item) } - - properties.rows.forEach(propperty => { - models.vegetableProp - .create({ - vegetablesId: item.id, - propertyId: propperty.id - }) - .then(() => { - saved += 1 - _callback() - }) - .catch((e) => { - console.log(e) - saved += 1 - _callback() - }) - }) } + + properties.rows.forEach(propperty => { + models.vegetableProp + .create({ + vegetablesId: item.id, + propertyId: propperty.id + }) + .then(() => { + saved += 1 + _callback() + }) + .catch((e) => { + console.log(e) + saved += 1 + _callback() + }) + }) } else { callback(null, item) }