Skip to content

Make default scope overridableΒ #3279

@smyth64

Description

@smyth64

Hey there!

Description/Steps to reproduce

I just created a model and also a default scope for its relation:

Mother.json

  "scope": {
    "include": [
      {
        "relation": "children"
      },
    ]
  }

When I do a normal query at /api/mother I get all children. Fine.

But when I try this:

/api/mother/?filter={"include": [ { "relation": "children", "scope": { "name": "Barney" } } ] }

I still get all children.
When I remove the default scope, my query works.

Expected result

It would be really nice, if the default scope for "children" gets overridden, if I provide a custom scope in my query.

Additional information

I hope you understand what I mean :)

πŸ‘ πŸ‘ πŸ‘ LOOPBACK IS AWESOME!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions