|
|
|
@ -5202,7 +5202,8 @@ exports.getDisconnectedIssuesBySupportId = async (req, reply) => {
|
|
|
|
|
const connectedSlaves = await Insensors.find({
|
|
|
|
|
connected_to: masterSensor.hardwareId,
|
|
|
|
|
type: "slave",
|
|
|
|
|
customerId
|
|
|
|
|
customerId,
|
|
|
|
|
connected_status: "disconnected"
|
|
|
|
|
}).lean();
|
|
|
|
|
|
|
|
|
|
const slaveSet = new Set(master.connected_slaves.map(s => s.hardwareId));
|
|
|
|
@ -5490,7 +5491,8 @@ exports.getDisconnectedCustomerDetails = async (req, reply) => {
|
|
|
|
|
console.log("hardwareIdsArray",hardwareIdsArray)
|
|
|
|
|
// 4. Find disconnected insensors using connected_to match
|
|
|
|
|
const disconnectedSensors = await Insensors.find({
|
|
|
|
|
connected_to: { $in: hardwareIdsArray }
|
|
|
|
|
connected_to: { $in: hardwareIdsArray },
|
|
|
|
|
connected_status: "disconnected"
|
|
|
|
|
}).lean();
|
|
|
|
|
|
|
|
|
|
if (!disconnectedSensors.length) {
|
|
|
|
|