Added more logs for debugging.
This commit is contained in:
@@ -21,6 +21,8 @@ const {
|
|||||||
const { sendEmail } = require("../services/emailService");
|
const { sendEmail } = require("../services/emailService");
|
||||||
|
|
||||||
const notifyForNewRealEstates = async newRealEstates => {
|
const notifyForNewRealEstates = async newRealEstates => {
|
||||||
|
//
|
||||||
|
console.log("[DEBUGGING] Function notifyForNewRealEstates started.");
|
||||||
const matches = await matchRealEstates(newRealEstates);
|
const matches = await matchRealEstates(newRealEstates);
|
||||||
await notifyMatches(matches);
|
await notifyMatches(matches);
|
||||||
};
|
};
|
||||||
@@ -46,12 +48,17 @@ const notifyForNewSearchRequest = async searchRequest => {
|
|||||||
|
|
||||||
const notifyMatches = async (matches, dailyNotification = false) => {
|
const notifyMatches = async (matches, dailyNotification = false) => {
|
||||||
const searchRequestsToNotify = Object.keys(matches);
|
const searchRequestsToNotify = Object.keys(matches);
|
||||||
|
//
|
||||||
|
console.log("[DEBUGGING] Function notifyMatches started.");
|
||||||
|
|
||||||
const asyncSendEmailActions = [];
|
const asyncSendEmailActions = [];
|
||||||
for (const id of searchRequestsToNotify) {
|
for (const id of searchRequestsToNotify) {
|
||||||
const { searchRequest, notifyNow } = matches[id];
|
const { searchRequest, notifyNow } = matches[id];
|
||||||
const { email, subscribed } = searchRequest;
|
const { email, subscribed } = searchRequest;
|
||||||
if (notifyNow && subscribed) {
|
if (notifyNow && subscribed) {
|
||||||
|
//
|
||||||
|
console.log("[DEBUGGING] Function notifyMatches - if statement true.");
|
||||||
|
|
||||||
const allMatchingRealEstates = matches[id].realEstates || [];
|
const allMatchingRealEstates = matches[id].realEstates || [];
|
||||||
|
|
||||||
//Variable allMatchingRealEstates are real estates that are "new" on the market
|
//Variable allMatchingRealEstates are real estates that are "new" on the market
|
||||||
|
|||||||
Reference in New Issue
Block a user