diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 3833d83c..194d438d 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2394,7 +2394,7 @@ const sendNotification = async (customerId, fcmIds, title, body) => { const now = new Date(); const lastSent = new Date(lastNotificationSent || 0); - // If preference is not "always", check the timing + // If preference is not "always", check the timing // if (notificationPreference !== "always") { // let minInterval = 0; @@ -2418,7 +2418,7 @@ const sendNotification = async (customerId, fcmIds, title, body) => { // } // Send notifications - const notificationPromises = validTokens.map(async (token) => { + const notificationPromises = flatTokens.map(async (token) => { try { const response = await admin.messaging().send({ notification: { title, body },