Skip to content

Commit

Permalink
Constants + ToDo, email on local
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh Patel committed Oct 29, 2019
1 parent 1bee227 commit d8b634a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions middlewares/search.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const Services = {
const Middleware = {
Util: require("../middlewares/util.middleware")
}
const Constants = require("../../constants/general.constant");

/**
* @function parseQuery
Expand Down
15 changes: 15 additions & 0 deletions services/search.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,21 @@ function executeAction(model, queryArray, page, limit, sort, sort_by, shouldExpa
return query.limit(limit)
.skip(limit * page).updateMany({ $set: { "status": new_status } })
.exec();
//HERE CHECK IF EMAIL, and if so, then look @ status and see if its in the constants.
// IF SO then call the email service sendMany with all the emails of hackers from the query.
// NOT SURE IF WE SHOULD MAKE IT EXTENSIBLE, so have it where this gets passed a function, and function
// Is called with specific params selected from each hacker????



//Logic for 2nd option:
/*
pass function to here & object of select params that the function takes.
execute find query, with callback of:
- function(err, arr) ... if no err then loop through each hacker in arr.
- for every hacker call the function passed in with each appropriate params req. (! must be given in order)
*/
}

module.exports = {
Expand Down

0 comments on commit d8b634a

Please sign in to comment.