IO-2935-Add-Enhanced-Websocket-Provider - add emit from io-logging event to create additional useage
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -7,9 +7,11 @@ require("dotenv").config({
|
||||
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`)
|
||||
});
|
||||
|
||||
// Emit this to bodyshop room
|
||||
|
||||
exports.default = async (req, res) => {
|
||||
const { useremail, bodyshopid, operationName, variables, env, time, dbevent, user } = req.body;
|
||||
|
||||
const { ioRedis } = req;
|
||||
try {
|
||||
await client.request(queries.INSERT_IOEVENT, {
|
||||
event: {
|
||||
@@ -22,6 +24,12 @@ exports.default = async (req, res) => {
|
||||
useremail
|
||||
}
|
||||
});
|
||||
|
||||
ioRedis.to(bodyshopid).emit("bodyshop-message", {
|
||||
operationName,
|
||||
useremail
|
||||
});
|
||||
|
||||
res.sendStatus(200);
|
||||
} catch (error) {
|
||||
logger.log("ioevent-error", "trace", user, null, {
|
||||
|
||||
Reference in New Issue
Block a user