Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpd.post inside dpd-event job does not trigger emit to client browser #28

Open
ramstein74 opened this issue Jul 3, 2018 · 0 comments
Open

Comments

@ramstein74
Copy link

Hello i´m trying to notify the user browser when a dpd-event job inserts a record in a collection.
in the web app i have this code:
dpd.lixo.on('changed',function(a){console.log(a)})

then i a dpd-event job i have the next

dpd.lixo.post({"nome": "Hello world","idade":22}).then(function(todo) {
console.log(todo);
}, function(err) {
console.log(err);
});

creates a new record in lixo collections but the on post code in lixo collection does not execute this single line:
emit("lixo:changed", "new record");
when i execute the same post code in the browser console i get the emitted message
when i use postman chrome app to do the same post request it triggers the lixo collection emit code to the browser.

Why dpd-event job does not trigger the emit action?
regards
António

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant