arrow-flow-invoke
Advanced tools
Comparing version 3.0.0-18 to 3.0.0-19
{ | ||
"name": "arrow-flow-invoke", | ||
"version": "3.0.0-18", | ||
"version": "3.0.0-19", | ||
"description": "Flow-nodes for Arrow specific logic.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://platform.axway.com", |
@@ -84,2 +84,4 @@ const { FlowManager } = require('axway-flow'); | ||
let spec; | ||
const pkName = model.getPrimaryKeyName(); | ||
switch (methodName) { | ||
@@ -137,8 +139,7 @@ case 'count': | ||
properties: { | ||
id: { | ||
// Models and connectors don't expose type information for | ||
// primary key field. | ||
[pkName]: { | ||
type: 'string' | ||
} | ||
}, | ||
required: [ 'id' ], | ||
required: [ pkName ], | ||
additionalProperties: false | ||
@@ -283,8 +284,7 @@ }, | ||
properties: { | ||
id: { | ||
// Models and connectors don't expose type information for | ||
// primary key field. | ||
[pkName]: { | ||
type: 'string' | ||
} | ||
}, | ||
required: [ 'id' ], | ||
required: [ pkName ], | ||
additionalProperties: false | ||
@@ -336,5 +336,4 @@ }, | ||
properties: { | ||
id: { | ||
// Models and connectors don't expose type information for | ||
// primary key field. | ||
[pkName]: { | ||
type: 'string' | ||
}, | ||
@@ -345,3 +344,3 @@ data: { | ||
}, | ||
required: [ 'id', 'data' ], | ||
required: [ pkName, 'data' ], | ||
additionalProperties: false | ||
@@ -480,3 +479,3 @@ }, | ||
cb.next = this._objectify(cb.next); | ||
this.model.delete(req.params.id, (err, result) => { | ||
this.model.delete(req.params[this.primaryKey], (err, result) => { | ||
// Not great but ORM layer doesn't just return null when not found | ||
@@ -526,3 +525,3 @@ if (err && err.match | ||
cb.next = this._objectify(cb.next); | ||
this.model.findByID(req.params.id, (err, result) => { | ||
this.model.findByID(req.params[this.primaryKey], (err, result) => { | ||
if (result) { | ||
@@ -545,3 +544,3 @@ cb.next(err, result); | ||
cb.next = this._objectify(cb.next); | ||
const data = Object.assign({}, req.params.data, { id: req.params.id }); | ||
const data = Object.assign({}, req.params.data, { [this.primaryKey]: req.params[this.primaryKey] }); | ||
this.model.update(data, (err, result) => { | ||
@@ -548,0 +547,0 @@ // Not great but ORM layer doesn't just return null when not found |
64302
874