Skip to content

Commit bf5c206

Browse files
committed
Fix description of updateAll response
Correctly describe the first non-error callback arg as an `info` object containing a `count` property.
1 parent 765e530 commit bf5c206

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

lib/persisted-model.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,15 @@ module.exports = function(registry) {
795795
description: 'An object of model property name/value pairs'},
796796
],
797797
returns: {
798-
arg: 'count',
799-
description: 'The number of instances updated',
800-
type: 'object',
801-
root: true
798+
arg: 'info',
799+
description: 'Information related to the outcome of the operation',
800+
type: {
801+
count: {
802+
type: 'number',
803+
description: 'The number of instances updated',
804+
},
805+
},
806+
root: true,
802807
},
803808
http: {verb: 'post', path: '/update'}
804809
});

test/remoting.integration.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ function formatReturns(m) {
269269
return '';
270270
}
271271
var type = returns[0].type;
272+
273+
// handle anonymous type definitions, e.g
274+
// { arg: 'info', type: { count: 'number' } }
275+
if (typeof type === 'object' && !Array.isArray(type))
276+
type = 'object';
277+
272278
return type ? ':' + type : '';
273279
}
274280

0 commit comments

Comments
 (0)