diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 0d32f301..ff66269c 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -121,6 +121,8 @@ exports.getTank = async (req, reply) => { throw boom.boomify(err); } }; + + //exports.getTanklevels = async (req, reply) => { // try { // const customerId = req.params.customerId; @@ -150,7 +152,7 @@ exports.updateTanklevels = async (req, reply) => { for (const tank of tanks) { const tankId = tank._id; let capacity = parseInt(tank.capacity.replace(/,/g, ''), 10); - let waterLevel = capacity - 100; // initial water level + let waterLevel = parseInt(tank.waterlevel.replace(/,/g, ''), 10); const intervalId = setInterval(async function () { const newWaterLevel = Math.floor(waterLevel - 200);