Fixed bug

This commit is contained in:
dbroqua 2018-10-10 21:14:38 +02:00
parent e93ad5d7b3
commit a09d88684e

View file

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