-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathemail.controller.js
More file actions
39 lines (35 loc) · 1018 Bytes
/
email.controller.js
File metadata and controls
39 lines (35 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"use strict";
const Constants = {
Success: require("../constants/success.constant"),
Error: require("../constants/error.constant"),
};
/**
* @function getStatusCount
* @param {{body: {count: number}}} req
* @param {*} res
* @return {JSON} Success status and count
* @description Returns the count of hackers with specified status
*/
function getStatusCount(req, res) {
return res.status(200).json({
message: "Successfully retrieved count",
data: { count: req.body.count },
});
}
/**
* @function sendAutomatedStatusEmails
* @param {{body: {results: {success: number, failed: number}}}} req
* @param {*} res
* @return {JSON} Success status and email results
* @description Returns the results of sending automated status emails
*/
function sendAutomatedStatusEmails(req, res) {
return res.status(200).json({
message: "Successfully sent emails",
data: req.body.results,
});
}
module.exports = {
getStatusCount,
sendAutomatedStatusEmails,
};