Changed to send email only to some users.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
const db = require("../../models/index");
|
||||
const sequelize = require("sequelize");
|
||||
const Op = sequelize.Op;
|
||||
const { CHECK_UP_DAYS } = require("../../config/appConfig");
|
||||
|
||||
const findRealEstatesForSearchRequest = async searchRequestId => {
|
||||
@@ -53,11 +55,18 @@ const findAllRequestsForCheckUp = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const excludedRequests = await db.SearchRequestMatch.findAll({
|
||||
const excludedMatches = await db.SearchRequestMatch.findAll({
|
||||
attributes: ["searchRequestId"],
|
||||
where: dateQuery
|
||||
where: dateQuery,
|
||||
order: [["searchRequestId", "ASC"]]
|
||||
});
|
||||
|
||||
const excludedRequestsAll = excludedMatches.map(match => {
|
||||
return match.dataValues.searchRequestId;
|
||||
});
|
||||
//Removing duplicate search request id-s for optimization
|
||||
const excludedRequests = [...new Set(excludedRequestsAll)];
|
||||
|
||||
const query = {
|
||||
subscribed: true,
|
||||
id: {
|
||||
|
||||
Reference in New Issue
Block a user