Skip to content

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

@ramstein74

Description

@ramstein74

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions