mean-expert-official / loopback-sdk-builder

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

Why aren't custom filters getting pick up in loopback? #627

Open jonathanwoahn opened 6 years ago

jonathanwoahn commented 6 years ago

What type of issue are you creating?

What version of this module are you using?

Write other if any:

I've added a mixin to my loopback instance that handles a custom parameter in the filter object. However, it's not getting picked up from the Angular client. I've noticed the filter params are passed in the headers instead of a string in the query url--i'm guessing this has something to do with the reason it isn't working, but I'm kind of at a loss here. Any suggestions?

jonathanwoahn commented 6 years ago

I ended up writing a function in the API to check where the incoming filter object was coming from, and pull it from there. So that's working, but unfortunately the Angular SDK is expecting results on the "find" method to be returned as an array, so if I return it in any other format (i.e. object with some request metadata + the requested results) it's throwing an error.

First question is still open, but any suggestions on getting around that issue?

dreamdevil00 commented 6 years ago

@jonathanwoahn Change your remote method prefix find to something else, such as get

netishix commented 4 years ago

@jonathanwoahn Change your remote method prefix find to something else, such as get

Worked for me.