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