Skip to content

Commit 20e18af

Browse files
committed
addedNotiAlertType
1 parent 49c40c3 commit 20e18af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/controllers/NotiController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ class NotificationController {
119119
};
120120
sendAlert = async (req, res) => {
121121
try {
122-
const { mobile, message, email, subject, text, uid } = req.body;
123-
console.log(mobile, message, email, subject, text, uid)
124-
if (!mobile || !message || !email || !subject || !text || !uid) {
122+
const { mobile, message, email, subject, text, uid,type } = req.body;
123+
console.log(mobile, message, email, subject, text, uid,type)
124+
if (!mobile || !message || !email || !subject || !text || !uid || !type) {
125125
return response(res, 400, { error: "All fields (mobile, message, email, subject, text) are required." });
126126
}
127127

@@ -135,7 +135,7 @@ class NotificationController {
135135
const newNotification = new Notification({
136136
description: message,
137137
uid, // Modify as needed
138-
type: "ALERT",
138+
type,
139139
toEmail: email,
140140
toNumber: mobile,
141141
from: "DG ADMIN",

0 commit comments

Comments
 (0)