Support data field as body for link operation
Signed-off-by: Clark Wang <clark.wangs@gmail.com>
This commit is contained in:
parent
9b97014b52
commit
beea028d5f
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue