Support data field as body for link operation

Signed-off-by: Clark Wang <clark.wangs@gmail.com>
This commit is contained in:
Clark Wang 2014-09-01 08:52:24 +08:00
parent 9b97014b52
commit beea028d5f
1 changed files with 4 additions and 1 deletions

View File

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