release/2024-11-01 - Update Trigger for job_updated

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-10-30 12:07:50 -07:00
parent 8190958ba3
commit dd5961d419
2 changed files with 22 additions and 44 deletions

View File

@@ -3,7 +3,7 @@ const { isObject } = require("lodash");
const jobUpdated = async (req, res) => {
const { ioRedis, logger, ioHelpers } = req;
if (!req?.body?.event?.data?.new || !isObject(req?.body?.event?.data?.new)) {
if (!req?.body?.data || !isObject(req.body.data)) {
logger.log("job-update-error", "ERROR", req.user?.email, null, {
message: `Malformed Job Update request sent from Hasura`,
body: req?.body
@@ -22,7 +22,7 @@ const jobUpdated = async (req, res) => {
// jobid: req?.body?.event?.data?.new?.id
// });
const updatedJob = req.body.event.data.new;
const updatedJob = req.body.data;
const bodyshopID = updatedJob.shopid;
// Emit the job-updated event only to the room corresponding to the bodyshop