preserving message properties now
This commit is contained in:
parent
1dc5e9fdb1
commit
1ba040ab2e
3 changed files with 3 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ module.exports = function (RED) {
|
||||||
const data = Array.isArray(msg.payload) ? msg.payload : [msg.payload]
|
const data = Array.isArray(msg.payload) ? msg.payload : [msg.payload]
|
||||||
|
|
||||||
api.addRecords(this.table, data).then(data => {
|
api.addRecords(this.table, data).then(data => {
|
||||||
node.send({ payload: data, topic: this.table })
|
node.send({ ...msg, payload: data })
|
||||||
}).catch(reason => done(reason, "Failed to perform grist request to " + url));
|
}).catch(reason => done(reason, "Failed to perform grist request to " + url));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ module.exports = function (RED) {
|
||||||
node.log(`filter evaluated to: ${JSON.stringify(filter)}`)
|
node.log(`filter evaluated to: ${JSON.stringify(filter)}`)
|
||||||
const api = new GristDocAPI(this.document.docid, { apiKey: this.server.apiKey, server: url });
|
const api = new GristDocAPI(this.document.docid, { apiKey: this.server.apiKey, server: url });
|
||||||
api.fetchTable(this.table, filter).then(data => {
|
api.fetchTable(this.table, filter).then(data => {
|
||||||
node.send({ payload: data, topic: this.table })
|
node.send({ ...msg, payload: data })
|
||||||
}).catch(reason => done(reason, "Failed to perform grist request to " + url));
|
}).catch(reason => done(reason, "Failed to perform grist request to " + url));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ module.exports = function (RED) {
|
||||||
const data = Array.isArray(msg.payload) ? msg.payload : [msg.payload]
|
const data = Array.isArray(msg.payload) ? msg.payload : [msg.payload]
|
||||||
|
|
||||||
api.updateRecords(this.table, data).then(data => {
|
api.updateRecords(this.table, data).then(data => {
|
||||||
node.send({ payload: data, topic: this.table })
|
node.send({ ...msg, payload: data })
|
||||||
}).catch(reason => done(reason, "Failed to perform grist request to " + url));
|
}).catch(reason => done(reason, "Failed to perform grist request to " + url));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue