Send templated bulk email, and remember notifed marketalerts
This commit is contained in:
@@ -11,15 +11,15 @@ const allRERequest = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find all unnotified marketalerts, and order them by email
|
||||
* Find all , or all depending on notified bolean marketalerts, and order them by email
|
||||
*
|
||||
* @param fechAll bolean
|
||||
* @param notified bolean
|
||||
*
|
||||
* @returns array of MarketAlerts
|
||||
*/
|
||||
const allMarketAlerts = async (notified) => {
|
||||
const allMarketAlerts = async (fetchAll, notified) => {
|
||||
|
||||
let queryObject = {
|
||||
order: [
|
||||
@@ -27,27 +27,19 @@ const allMarketAlerts = async (notified) => {
|
||||
]
|
||||
}
|
||||
|
||||
if (notified){
|
||||
if (!fetchAll){
|
||||
queryObject.where = {
|
||||
notified: notified
|
||||
}
|
||||
}
|
||||
return await db.MarketAlert.findAll(queryObject);
|
||||
|
||||
// return await db.MarketAlerts.findAll({
|
||||
// where: {
|
||||
// notified: notified
|
||||
// },
|
||||
// order: [
|
||||
// ['email', 'DESC'],
|
||||
// ]
|
||||
// });
|
||||
return await db.MarketAlert.findAll(queryObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all unnotified marketalerts
|
||||
* @param latLng array
|
||||
* @param email strig
|
||||
* @param email string
|
||||
*
|
||||
* @returns array of MarketAlerts
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user