add allowArray to relations' 'create' remoteMethod#2947
Conversation
66883ec to
8357390
Compare
accepted from model's remoteMethodaccepted from model's remoteMethod
|
@slnode test please |
8357390 to
9d0bb18
Compare
| accepts: { arg: 'data', type: 'object', model: toModelName, http: { source: 'body' }}, | ||
| // retrieve original remoteMethod's arguments, so it properly inherits options | ||
| accepts: retrieveRemoteMethodInformation.call(this, toModelName, 'create') ? | ||
| retrieveRemoteMethodInformation.call(this, toModelName, 'create').accepts[0] : |
There was a problem hiding this comment.
@bajtos do you think it make sense to try to inherit the accept from the remoteClass, or its too much trouble for too little benefits?
we could also simply just add allowArray here
There was a problem hiding this comment.
In this case, I would simply copy the allowArray flag. Relation methods are similar but not the same as original DAO methods. In the future, their REST API may diverge, in which case we would not want to share argument metadata.
|
@slnode test please |
1 similar comment
|
@slnode test please |
3052828 to
0f4bd37
Compare
accepted from model's remoteMethod| .end(function(err, result) { | ||
| if (err) return done(err); | ||
| expect(result.body).to.have.property('id'); | ||
| expect(result.body).to.have.property('title', aPost.title); |
There was a problem hiding this comment.
can this be changed to :
expect(result.body.title).to.eql(aPost.title)
There was a problem hiding this comment.
has discussion with @gunjpan decided to keep it the same
this is needed because we added allowArray flag to persisted model's remoteMethod, but when relations try to rebuild such methods, it does not carry over such flags
0f4bd37 to
fa7cb92
Compare
connected to #2928
Description
this is a problem where relation's model's remoteMethods are rebuilt (not inherited).
Eg lets say
POST /book(book.create) has flag allowArrayPOST /Author/id/Bookwill rebuildremoteMethodper relation typeRelated issues
Checklist
guide
this is needed because we added allowArray flag to persisted model's
remoteMethod, but when relations try to rebuild such methods, it does
not carry over such flags
Update 16/11/16:
Update 17/11/16: