From 8cb4f80c252244dd22a5ac6ffad27b0f887fe178 Mon Sep 17 00:00:00 2001 From: varun Date: Thu, 16 May 2024 06:38:00 -0400 Subject: [PATCH] change in iotdata if tank not found for tankhardwareId --- src/controllers/tanksController.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 50e6f00f..e9cf557c 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -1342,9 +1342,7 @@ exports.IotDevice = async (req, reply) => { // Update waterlevel in tanksSchema for each tank for (const tank of tanks) { const { tankhardwareId, tankHeight } = tank; - if (!existingTank) { - continue; // Skip the rest of the loop body and move to the next iteration - } + // console.log(tankhardwareId) // Find the corresponding tank in tanksSchema const existingTank = await Tank.findOne({ hardwareId, tankhardwareId });