Closed bajtos closed 5 years ago
In LoopBack, the method PersistedModel.updateAll describes the return type using an inline (anonymous) definition:
PersistedModel.updateAll
{ returns: { arg: 'info', type: { count: { type: 'number', description: 'The number of instances updated', }, }, root: true, }, }
Before this change, remote invocation of updateAll was crashing the process with the following error:
AssertionError: type must be either an array or a string.
This patch fixes the problem as follows:
A try/catch block is introduced to correctly report any sync errors via the callback
The type registry was improved to recognize anonymous object types and use the "object" converter for them.
Fixes https://github.com/strongloop/loopback/issues/3717
/cc @angfal @ewrayjohnson
In LoopBack, the method
PersistedModel.updateAll
describes the return type using an inline (anonymous) definition:Before this change, remote invocation of updateAll was crashing the process with the following error:
This patch fixes the problem as follows:
A try/catch block is introduced to correctly report any sync errors via the callback
The type registry was improved to recognize anonymous object types and use the "object" converter for them.
Related issues
Fixes https://github.com/strongloop/loopback/issues/3717
/cc @angfal @ewrayjohnson
Checklist