Bug fix. Alert date was not being correctly read by afterCreate function

This commit is contained in:
JayWll 2020-05-06 08:22:17 -06:00
parent 767dc3ff7b
commit 282a45d9ee

View File

@ -25,7 +25,7 @@ const Readings = sequelize.define('readings', {
const lowtrigger = parseInt(result.find(o => o.dataValues.key === 'low-trigger').dataValues.value)
const hightrigger = parseInt(result.find(o => o.dataValues.key === 'high-trigger').dataValues.value)
const low = result.find(o => o.dataValues.key === 'low').dataValues.value
const alert = result.find(o => o.dataValues.key === 'low-trigger').dataValues.value
const alert = result.find(o => o.dataValues.key === 'alert').dataValues.value
// Reset low moisture flag if it's set, and the reading is greater than high-trigger