Used string service instead of hardcoded value.
This commit is contained in:
1 parent
5be17af4c1
commit
4ef2b294bb
1 file changed
+6
-6
@@ -22,17 +22,17 @@ class NotificationController {
|
|||||||
next(handleValidationError(error, SERVICE_NAME));
|
next(handleValidationError(error, SERVICE_NAME));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { monitorId, type, platform, config } = req.body;
|
const { monitorId, type, platform, config } = req.body;
|
||||||
|
|
||||||
const networkResponse = {
|
const networkResponse = {
|
||||||
monitor: { _id: monitorId, name: "Test Monitor", url: "http://www.google.com" },
|
monitor: { _id: monitorId, name: "Test Monitor", url: "http://www.google.com" },
|
||||||
status: false,
|
status: false,
|
||||||
statusChanged: true,
|
statusChanged: true,
|
||||||
prevStatus: true,
|
prevStatus: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type === "webhook") {
|
if (type === "webhook") {
|
||||||
const notification = {
|
const notification = {
|
||||||
type,
|
type,
|
||||||
@@ -45,11 +45,11 @@ class NotificationController {
|
|||||||
notification
|
notification
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.success({
|
return res.success({
|
||||||
msg: "Notification sent successfully"
|
msg: this.stringService.webhookSendSuccess
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
next(handleError(error, SERVICE_NAME, "triggerNotification"));
|
next(handleError(error, SERVICE_NAME, "triggerNotification"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user