From 91a1c6a91e2fdc1b95bb167109ed21fe22f33c37 Mon Sep 17 00:00:00 2001 From: Naida Vatric Date: Thu, 6 Feb 2020 14:12:35 +0100 Subject: [PATCH] Added more logs for debugging. --- app/services/notificationService.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/services/notificationService.js b/app/services/notificationService.js index 525b4d7..e9d7283 100644 --- a/app/services/notificationService.js +++ b/app/services/notificationService.js @@ -21,6 +21,8 @@ const { const { sendEmail } = require("../services/emailService"); const notifyForNewRealEstates = async newRealEstates => { + // + console.log("[DEBUGGING] Function notifyForNewRealEstates started."); const matches = await matchRealEstates(newRealEstates); await notifyMatches(matches); }; @@ -46,12 +48,17 @@ const notifyForNewSearchRequest = async searchRequest => { const notifyMatches = async (matches, dailyNotification = false) => { const searchRequestsToNotify = Object.keys(matches); + // + console.log("[DEBUGGING] Function notifyMatches started."); const asyncSendEmailActions = []; for (const id of searchRequestsToNotify) { const { searchRequest, notifyNow } = matches[id]; const { email, subscribed } = searchRequest; if (notifyNow && subscribed) { + // + console.log("[DEBUGGING] Function notifyMatches - if statement true."); + const allMatchingRealEstates = matches[id].realEstates || []; //Variable allMatchingRealEstates are real estates that are "new" on the market