From f5edc7c60d4c0b3f909cfaf403a4d082f35a66b4 Mon Sep 17 00:00:00 2001 From: varun Date: Thu, 16 Mar 2023 03:53:49 -0400 Subject: [PATCH] initial update removed in updating tank levels --- src/controllers/tanksController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);