IO-2924-Refactor-Production-board-to-use-Socket-Provider: Finalize

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-09-25 21:34:43 -04:00
parent 60d1396011
commit c661fce8f1
2 changed files with 37 additions and 17 deletions

View File

@@ -24,7 +24,12 @@ const jobUpdated = async (req, res) => {
const bodyshopID = updatedJob.shopid;
// Emit the job-updated event only to the room corresponding to the bodyshop
ioRedis.to(bodyshopID).emit("job-updated", updatedJob);
// Note: We are only sending the ID, because that is all that is needed
// What we should do is prevent hasura from sending anything more than it
// but the rewrite templates are currently borked.
ioRedis.to(bodyshopID).emit("job-updated", { id: updatedJob.id });
return res.json({ message: "Job updated and event emitted" });
};