Removed debugg logs. Smal fixes.

This commit is contained in:
Naida Vatric
2020-02-06 22:40:56 +01:00
parent 91a1c6a91e
commit 97724a47a1
3 changed files with 3 additions and 32 deletions

View File

@@ -21,8 +21,6 @@ const {
const { sendEmail } = require("../services/emailService");
const notifyForNewRealEstates = async newRealEstates => {
//
console.log("[DEBUGGING] Function notifyForNewRealEstates started.");
const matches = await matchRealEstates(newRealEstates);
await notifyMatches(matches);
};
@@ -37,8 +35,7 @@ const notifyForNewSearchRequest = async searchRequest => {
matchingRealEstates
);
const { email } = searchRequest;
//DEBUGGING
console.log("[DEBUGGING]: Function notifyForNewSearchRequest-", stagingTag);
await sendEmail(
email,
`${stagingTag} Kivi - novi zahtjev za pretragu`,
@@ -48,17 +45,12 @@ 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
@@ -66,11 +58,6 @@ const notifyMatches = async (matches, dailyNotification = false) => {
//New variable allRealEstates are all real estates that exists in db for search req
const allRealEstates = await findRealEstatesForSearchRequest(id);
const noAllRealEstates = allRealEstates.length;
//DEBUGGING
console.log(
"[DEBUGGING] Function notifyMatches-noAllRealEstates:",
noAllRealEstates
);
if (allMatchingRealEstates.length > 0) {
const emailContent = generateNotificationEmail(