Skip to content

Commit d8b634a

Browse files
author
Harsh Patel
committed
Constants + ToDo, email on local
1 parent 1bee227 commit d8b634a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

middlewares/search.middleware.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const Services = {
55
const Middleware = {
66
Util: require("../middlewares/util.middleware")
77
}
8+
const Constants = require("../../constants/general.constant");
89

910
/**
1011
* @function parseQuery

services/search.service.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,21 @@ function executeAction(model, queryArray, page, limit, sort, sort_by, shouldExpa
143143
return query.limit(limit)
144144
.skip(limit * page).updateMany({ $set: { "status": new_status } })
145145
.exec();
146+
//HERE CHECK IF EMAIL, and if so, then look @ status and see if its in the constants.
147+
// IF SO then call the email service sendMany with all the emails of hackers from the query.
148+
// NOT SURE IF WE SHOULD MAKE IT EXTENSIBLE, so have it where this gets passed a function, and function
149+
// Is called with specific params selected from each hacker????
150+
151+
152+
153+
//Logic for 2nd option:
154+
/*
155+
pass function to here & object of select params that the function takes.
156+
execute find query, with callback of:
157+
- function(err, arr) ... if no err then loop through each hacker in arr.
158+
- for every hacker call the function passed in with each appropriate params req. (! must be given in order)
159+
160+
*/
146161
}
147162

148163
module.exports = {

0 commit comments

Comments
 (0)