Closed romainbriand closed 3 years ago
@romainbriand Where did you define that filter? I can't get the filter working on subresources.
@coudenysj First, thank you so much for your reply!
I have a first config file for the "parent" resource defined in the file config/api_platform/resources/myparentresource.yaml
as follow:
Blablabla\Entity\MyParentResource:
collectionOperations:
get:
filters: ['search_filter']
post: ~
properties:
MyChildResource:
subresource:
resourceClass: 'Blablabla\Entity\MyChildResource'
collection: true
maxDepth: 1
And then, I have another config file for the "child" resource config/api_platform/resources/mychildresource.yaml
as follow:
Blablabla\Entity\MyChildResource:
collectionOperations:
get:
filters: ['order_filter']
Does it help? I still think that maybe I could have done something wrong in the configuration.
Greetings! We appreciate your concern but weren't able to reproduce this issue or it is more of a question. As described in the API Platform contributing guide, we use GitHub issues for bugs and feature requests only.
For support question ("How To", usage advice, or troubleshooting your own code), you have several options:
Feel free reach one of the support channels above. In the meantime we're closing this issue.
Hi!
Because of relationships between entities, there is something that I don't really understand with filters, especially built-in doctrine order filter in this case.
Here is my (abstract) scheme: GET /resources/{resourceId}/subresources
I'm getting subresources pretty well. As you can see from the screen capture below, this subresource has the order filter enabled:
Only problem is that the filter is not applied, and my subresources are not ordered as expected (for example if I put "desc" value in order[date] field).
What am I doing wrong? Thanks a lot in advance for your help!