release/2024-11-01 - Update Trigger for job_updated
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user