Skip to content

Make default scope overridable #3279

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!!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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