Added delete ability.
This commit is contained in:
@@ -9,11 +9,16 @@ const { MAX_REAL_ESTATES_IN_FIRST_EMAIL } = require("../config/appConfig");
|
||||
const { EMAIL_FREQUENCY } = require("../common/enums");
|
||||
|
||||
const matchRealEstates = async realEstates => {
|
||||
if (Array.isArray(realEstates)) {
|
||||
//Filter deleted real estates
|
||||
const filteredRealEstates = realEstates.filter(
|
||||
realEstate => realEstate.deleted === false
|
||||
);
|
||||
|
||||
if (Array.isArray(filteredRealEstates)) {
|
||||
const asyncMatchActions = [];
|
||||
const matches = {};
|
||||
const matchingRecords = [];
|
||||
for (const realEstate of realEstates) {
|
||||
for (const realEstate of filteredRealEstates) {
|
||||
const searchRequestsPromise = findSearchRequestsForRealEstate(realEstate);
|
||||
asyncMatchActions.push(searchRequestsPromise);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user