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

Custom route masked by findOne route #3

Open
danielsharvey opened this issue Jun 19, 2018 · 0 comments
Open

Custom route masked by findOne route #3

danielsharvey opened this issue Jun 19, 2018 · 0 comments

Comments

@danielsharvey
Copy link

danielsharvey commented Jun 19, 2018

Sails version: v1.0.2
Node version: v10.2.1
NPM version: 6.1.0
Operating system: MacOS 10.13.5

I'm not sure if this is something that can be addressed by the sails-hook-custom-blueprints hook or needs attention in the sails project (I have submitted an issue).

When I use this hook to register a search.js blueprint, I am expecting to route

http://localhost:1337/api/v2/modelname/search

to the new blueprint.

However, this appears to be masked by the /:id route in sails:

_bindRestRoute('get %s/:id', 'findOne');

Is this the expected behaviour? It seems that this makes new (not one of the standard blueprint actions) blueprints unworkable.

Or, is the only way to override findOne and filter for my new action, passing back to the core implementation (!!) by default?

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

1 participant