From 4811e0d07e4609f9d652e21ab61bcb421999171e Mon Sep 17 00:00:00 2001 From: varun Date: Tue, 2 Jul 2024 06:03:54 -0400 Subject: [PATCH] made changes in motoraction --- src/controllers/tanksController.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index be07c2de..8cbdcd80 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -938,6 +938,7 @@ const formatDate = (date) => { return `${day}-${month}-${year} - ${hours}:${minutes}`; }; + exports.motorAction = async (req, reply) => { try { const customerId = req.params.customerId; @@ -1121,7 +1122,9 @@ exports.motorAction = async (req, reply) => { const capacity = parseInt(receiver_tank_info.capacity, 10); const waterLevel = parseInt(receiver_tank_info.waterlevel, 10); - const desired_percentage = parseInt(req.body.manual_threshold_litres, 10); + const desired_percentage = parseInt(req.body.manual_threshold_litres.replace(/,/g, ''), 10); + + console.log(desired_percentage) const threshold_water_level = waterLevel+desired_percentage; const supplier_threshold = supplier_waterLevel-desired_percentage