mean-expert-official / loopback-sdk-builder

Tool for auto-generating Software Development Kits (SDKs) for LoopBack
Other
399 stars 177 forks source link

custom methods with json params do not get appended to request body #53

Closed sprypradeep closed 8 years ago

sprypradeep commented 8 years ago

In the model function the "data" property is wrongly set from the first param (by ejs), this results in other params being missed, ideally we need to merge the params with data and send in request body:


    let result = this.request(method, url, urlParams, params<%= 
      postData && postData.length > 0 ? ", " + postData[0].arg : '' %>, true)<%

https://github.com/jonathan-casarrubias/loopback-sdk-builder/blob/master/lib/angular2/shared/services/custom/service.ejs#L194-L195

sprypradeep commented 8 years ago

we can just use the entire postData object and pass that on to "data",

jonathan-casarrubias commented 8 years ago

I think this is related to: https://github.com/jonathan-casarrubias/loopback-sdk-builder/issues/52

since is part of the same flow

Please provide a custom remote method configuration as you have configured, so I can add it to the tests.

jonathan-casarrubias commented 8 years ago

never mind I was able to replicate and fix it.. will be released in RC5

sprypradeep commented 8 years ago

Thank you!