From a2dd6ca34fdf3f053042e74f94c952cafe918d42 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Fri, 23 May 2025 12:58:31 +0530 Subject: [PATCH] changes --- src/controllers/installationController.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/controllers/installationController.js b/src/controllers/installationController.js index ab636105..ecca47b3 100644 --- a/src/controllers/installationController.js +++ b/src/controllers/installationController.js @@ -4601,21 +4601,25 @@ exports.getDisconnectedCustomerDetailsByTeamMemberId = async (req, reply) => { const customerIds = [...new Set(disconnectedDevices.map(d => d.customerId))]; const users = await User.find({ customerId: { $in: customerIds } }).lean(); + console.log("users",users) // Step 6: Prepare final response const response = users.map(user => ({ customerId: user.customerId, firstName: user.profile?.firstName || "", lastName: user.profile?.lastName || "", + address1: user.profile?.address1 || "", + address2: user.profile?.address2 || "", + phone: user.phone || user.profile?.contactNumber || "", email: user.emails?.[0]?.email || "", - city: user.profile?.city || "", - state: user.profile?.state || "", - country: user.profile?.country || "", + latitude: user.latitude, longitude: user.longitude, fcmIds: (user.fcmIds || []).filter(fcm => typeof fcm === "string"), installationId: user.installationId || "", + username: user.username || "", + buildingName: user.buildingName || "", notificationPreferences: { allowNotifications: user.allowNotifications || false, automaticStartAndStopNotify: user.automaticStartAndStopNotify || false,