feature/IO-3096-GlobalNotifications - Check-point

This commit is contained in:
Dave Richer
2025-02-11 10:40:57 -05:00
parent 54820fe3c8
commit 2ee582bfa2
9 changed files with 156 additions and 91 deletions

View File

@@ -1,5 +1,11 @@
const handleJobsChange = (req, res) => {
return res.status(200).json({ message: "Jobs change handled." });
};
const scenarioParser = require("../utils/scenarioParser");
const handleJobsChange = async (req, res) => {
const { logger } = req;
scenarioParser(req, `req.body.event.new.id`).catch((e) =>
logger.log("notifications-error", "error", "notifications", null, { error: e?.message })
);
return res.status(200).json({ message: "Job Notifications Event Handled." });
};
//
module.exports = handleJobsChange;

View File

@@ -2,8 +2,10 @@ const scenarioParser = require("../utils/scenarioParser");
const handleTasksChange = async (req, res) => {
const { logger } = req;
scenarioParser(req).catch((e) => logger.log("notifications-error", "error", "jsr", null, { error: e?.message }));
return res.status(200).json({ message: "Notification Scenario Event Handled." });
scenarioParser(req, "req.body.event.new.jobid").catch((e) =>
logger.log("notifications-error", "error", "notifications", null, { error: e?.message })
);
return res.status(200).json({ message: "Tasks Notifications Event Handled." });
};
//
module.exports = handleTasksChange;