Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks
jonathanwoahn opened this issue Oct 16, 2018 · 3 comments
Open
4 tasks

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

jonathanwoahn opened this issue Oct 16, 2018 · 3 comments

Comments

@jonathanwoahn
Copy link

jonathanwoahn commented Oct 16, 2018

What type of issue are you creating?

  • [X ] Bug
  • Enhancement
  • Question

What version of this module are you using?

  • 2.0.10 (Stable)
  • 2.1.0-rc.n (2.1 Release Candidate n)
  • [X ] Other (2.3.1)

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
Copy link
Author

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
Copy link
Contributor

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

@netishix
Copy link

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

Worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants