Skip to content

Custom route masked by findOne route #3

@danielsharvey

Description

@danielsharvey

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions