made changes in motoraction

master
varun 1 year ago
parent 3c34b48cbb
commit 4811e0d07e

@ -938,6 +938,7 @@ const formatDate = (date) => {
return `${day}-${month}-${year} - ${hours}:${minutes}`; return `${day}-${month}-${year} - ${hours}:${minutes}`;
}; };
exports.motorAction = async (req, reply) => { exports.motorAction = async (req, reply) => {
try { try {
const customerId = req.params.customerId; const customerId = req.params.customerId;
@ -1121,7 +1122,9 @@ exports.motorAction = async (req, reply) => {
const capacity = parseInt(receiver_tank_info.capacity, 10); const capacity = parseInt(receiver_tank_info.capacity, 10);
const waterLevel = parseInt(receiver_tank_info.waterlevel, 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 threshold_water_level = waterLevel+desired_percentage;
const supplier_threshold = supplier_waterLevel-desired_percentage const supplier_threshold = supplier_waterLevel-desired_percentage

Loading…
Cancel
Save