Skip to content

Commit 46ab65c

Browse files
authored
Merge pull request #2842 from strongloop/fix/metadata-update-delete-all
Fix description of updateAll response
2 parents 3229fdb + 1439446 commit 46ab65c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

lib/persisted-model.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,14 @@ module.exports = function(registry) {
808808
description: 'An object of model property name/value pairs' },
809809
],
810810
returns: {
811-
arg: 'count',
812-
description: 'The number of instances updated',
813-
type: 'object',
811+
arg: 'info',
812+
description: 'Information related to the outcome of the operation',
813+
type: {
814+
count: {
815+
type: 'number',
816+
description: 'The number of instances updated',
817+
},
818+
},
814819
root: true,
815820
},
816821
http: { verb: 'post', path: '/update' },

test/remoting.integration.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ function formatReturns(m) {
262262
return '';
263263
}
264264
var type = returns[0].type;
265+
266+
// handle anonymous type definitions, e.g
267+
// { arg: 'info', type: { count: 'number' } }
268+
if (typeof type === 'object' && !Array.isArray(type))
269+
type = 'object';
270+
265271
return type ? ':' + type : '';
266272
}
267273

0 commit comments

Comments
 (0)