1
votes

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"

1

1 Answers

0
votes

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

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