feature/IO-2924-Refactor-Production-Board-For-Sockets - Clear Stage

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-09-12 23:25:21 -04:00
parent 88b313b9d8
commit 62185196a8

View File

@@ -3,10 +3,7 @@ const { isObject } = require("lodash");
const jobUpdated = async (req, res) => {
const { io, logger } = req;
logger.log("job-update", "INFO", req.user?.email, null, {
message: `Job updated event received from Hasura`,
body: req?.body
});
console.dir(req.body, { depth: null });
if (!req?.body?.event?.data?.new || !isObject(req?.body?.event?.data?.new)) {
logger.log("job-update-error", "ERROR", req.user?.email, null, {
@@ -20,6 +17,11 @@ const jobUpdated = async (req, res) => {
});
}
logger.log("job-update", "INFO", req.user?.email, null, {
message: `Job updated event received from Hasura`,
jobid: req?.body?.event?.data?.new?.id
});
const updatedJob = req.body.event.data.new;
const bodyshopID = updatedJob.shopid;