master^2
Bhaskar 6 months ago
parent eb28852382
commit 11e76a6d82

@ -3133,10 +3133,22 @@ exports.motorAction = async (req, reply) => {
try {
const motorData = await MotorData.findOne({
customerId,
motor_id: motorId,
start_instance_id: dynamicInstanceId
});
let totalWaterPumped = 0; // Default value in case data is missing
if (motorData && motorData.quantity_delivered) {
totalWaterPumped = motorData.quantity_delivered;
}
console.log("quantity_delivered:", totalWaterPumped);
const totalWaterPumped = await motorData.quantity_delivered
console.log("quantity_delivered",totalWaterPumped)
//const totalWaterPumped = await motorData.quantity_delivered
// console.log("quantity_delivered",totalWaterPumped)
eventEmitter.emit("motorStop", customerId, fcmToken, tankName, blockName, stopTime, "Mobile APP", totalWaterPumped, typeOfWater, motorId,
loggedInUser.phone,);

Loading…
Cancel
Save