You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use pmx.emit to log out customer onboards before they are inserted into my database.
I have json filtering in place so I can insert my req.body directly into the database. I was just doing pmx.emit('customer:creation', req.body), then inserting it into my database. This fails. If I remove pmx.emit from the equation, it succeeds. somehow simply logging the object is modifying the object. Bad mojo.
This is our offending line of code, it apparently appends an __name as the event name to the object, but why is that necessary? Wouldn't it posit that these objects would be reused later possibly?
The text was updated successfully, but these errors were encountered:
I was trying to use pmx.emit to log out customer onboards before they are inserted into my database.
I have json filtering in place so I can insert my req.body directly into the database. I was just doing pmx.emit('customer:creation', req.body), then inserting it into my database. This fails. If I remove pmx.emit from the equation, it succeeds. somehow simply logging the object is modifying the object. Bad mojo.
https://github.com/keymetrics/pmx/blob/master/lib/events.js#L14
This is our offending line of code, it apparently appends an __name as the event name to the object, but why is that necessary? Wouldn't it posit that these objects would be reused later possibly?
The text was updated successfully, but these errors were encountered: