Hey there!
I am to query an API that has this endpoint to filter a one-to-one relationship:
http://localhost:5000/api/v1.0/posts?include=status&filter=[{"name":"status__status","op":"has","val":"Published"}]
I’ve tried this using Ember:
this.store.query('post', {filter:{"status":{"name":"status","op":"eq","val":"Published"} }});
And this:
this.store.query('post', {filter:{"name":"status","op":"eq","val":"Published"}});
But the resulting query are these:
http://localhost:5000/api/v1.0/posts?filter[status][name]=status&filter[status][op]=eq&filter[status][val]=Published
http://localhost:5000/api/v1.0/posts?filter[name]=status&filter[op]=eq&filter[val]=Published
Which is quite confusing! I am not sure how to create this queries when I have belongsTo and hasMany relationships.
What is the right way to create this query?
I’ve seen this references here and here but I couldn’t figure out how to write the right query.
Is there any other documentation that I could read to understand better how to create these queries?
Thanks in advance!