|
|
|
@ -1355,6 +1355,10 @@ exports.getMasterSlaveSummary = async (req, reply) => {
|
|
|
|
|
const loraTime = slave.connected_lora_time || null;
|
|
|
|
|
const loraDate = slave.connected_lora_date || null;
|
|
|
|
|
|
|
|
|
|
// Fetch masterName using the connected_to masterId
|
|
|
|
|
const master = masters.find(m => m.hardwareId === masterId);
|
|
|
|
|
const masterName = master ? master.masterName : 'Unknown';
|
|
|
|
|
|
|
|
|
|
slaveMap[masterId].push({
|
|
|
|
|
hardwareId: slave.hardwareId,
|
|
|
|
|
tankName: slave.tankName || null,
|
|
|
|
@ -1366,7 +1370,9 @@ exports.getMasterSlaveSummary = async (req, reply) => {
|
|
|
|
|
typeOfWater: slave.typeOfWater || 'N/A', // Add 'typeOfWater' field
|
|
|
|
|
lora_last_check_time: slave.connected_lora_date && slave.connected_lora_time
|
|
|
|
|
? `${slave.connected_lora_date} ${slave.connected_lora_time}`
|
|
|
|
|
: null // Add 'lora_last_check_time' field
|
|
|
|
|
: null, // Add 'lora_last_check_time' field
|
|
|
|
|
connected_to: slave.connected_to, // Add 'connected_to' field
|
|
|
|
|
masterName: masterName // Add 'masterName' field
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|