diff --git a/lib/models/model.js b/lib/models/model.js index e490804c..0df6638d 100644 --- a/lib/models/model.js +++ b/lib/models/model.js @@ -431,9 +431,12 @@ Model.hasManyRemoting = function (relationName, relation, define) { define('__link__' + relationName, { isStatic: false, http: {verb: 'put', path: '/' + pathName + '/rel/:fk'}, - accepts: {arg: 'fk', type: 'any', + accepts: [ + {arg: 'fk', type: 'any', description: 'Foreign key for ' + relationName, required: true, http: {source: 'path'}}, + {arg: 'data', type: modelThrough.modelName, http: {source: 'body'}} + ], description: 'Add a related item by id for ' + relationName, returns: {arg: relationName, type: modelThrough.modelName, root: true} }, addFunc);