You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is something that can be addressed by the sails-hook-custom-blueprints hook (I have submitted an issue) or needs attention in the sails project.
When I use the sails-hook-custom-blueprints 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? (this does not seem optimal)
The text was updated successfully, but these errors were encountered:
@danielsharvey It's possible the custom hook for this route is not being implemented correctly. Have you double checked the hook specification for .routes to make sure everything is configured correctly? It sounds like the blueprints are still defaulting back to the fineOne route instead of the custom blueprint for http://localhost:1337/api/v2/modelname/search.
Sails version: v1.0.2
Node version: v10.2.1
NPM version: 6.1.0
DB adapter name: N/A
DB adapter version: N/A
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 (I have submitted an issue) or needs attention in the sails project.When I use the
sails-hook-custom-blueprints
hook to register asearch.js
blueprint, I am expecting to routeto the new blueprint.
However, this appears to be masked by the
/:id
route in sails: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? (this does not seem optimal)The text was updated successfully, but these errors were encountered: