diff --git a/pglisten.js b/pglisten.js index 96e095f..f60c4d0 100644 --- a/pglisten.js +++ b/pglisten.js @@ -55,10 +55,13 @@ module.exports = function(RED) { node.status({fill:"green",shape:"dot",text:"connected"}); node.clientdb.on('notification', function(msg) { try { - //console.log("Notification received"); - msg.payload = JSON.parse(msg.payload); - //node.log(JSON.stringify(msg)); - node.send(msg); + var outmsg = {}; + outmsg.payload = JSON.parse(msg.payload); + delete msg.payload; + outmsg.topic = msg.channel; + delete msg.channel; + outmsg.pg_data = msg; + node.send(outmsg); } catch (error) { node.error(error); }