J.Doe
J.Doe

Reputation: 35

Write filter condition inside filter include in StrongLoop

I write in Node this filter:

include: {
relation: 'province',
scope: {
    where: {
        'regionId': 9
    }
}}

The filter working properly, the rest api filter that I wrote is like this:

filter[include][province][scope][where][regionId]=9

I have this error:

"error": { "name": "Error", "status": 500, "message": "Relation \"scope\" is not defined for Provinces model"

Upvotes: 1

Views: 95

Answers (1)

Ebrahim Pasbani
Ebrahim Pasbani

Reputation: 9396

You can use json filter like calling in node, and this is not REST like

?filter={"include": {"relation": "province","scope": {"where": {"regionId": 9}}}}

Upvotes: 0

Related Questions