pkey is array
This commit is contained in:
parent
7acb8d9303
commit
d676884ae8
2 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
},
|
},
|
||||||
inputs: 1,
|
inputs: 1,
|
||||||
outputs: 1,
|
outputs: 1,
|
||||||
icon: "font-awesome/fa-rotate",
|
icon: "font-awesome/fa-table",
|
||||||
label: function () {
|
label: function () {
|
||||||
return this.tableId ? `[Sync] ${this.tableId}` : "Sync table";
|
return this.tableId ? `[Sync] ${this.tableId}` : "Sync table";
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ module.exports = function (RED) {
|
||||||
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 });
|
||||||
const data = Array.isArray(msg.payload) ? msg.payload : [msg.payload]
|
const data = Array.isArray(msg.payload) ? msg.payload : [msg.payload]
|
||||||
|
|
||||||
api.syncTable(this.table, data, this.primaryKey).then(data => {
|
api.syncTable(this.table, data, [this.primaryKey]).then(data => {
|
||||||
node.send({ ...msg, payload: data })
|
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