[BUG] Usemany not populating relations no StrapiV4
See original GitHub issueDescribe the bug When you use useMany hook, metadata-> populate generate a proper URL
To Reproduce
use this code as template:
const { data: casosData, isLoading }: any = useMany<any>({
resource: "casos",
ids: [2, 3],
metaData: {
populate: ["pessoa_fisicas"],
},
});
It will make this request: http://127.0.0.1:1337/api/casos?filters[id][$in]=2&filters[id][$in]=3 I should make this request: http://127.0.0.1:1337/api/casos?filters[id][$in]=2&filters[id][$in]=3**&populate=pessoa_fisicas**
- Used dataProvider: Strapi
Additional context I also tried with a Simple Rest API and it seems it wont work either.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
v4 Creating relations with/populating users causes 500 #11847
When trying to populate relations on the User collection from the user-permission plugins returns a 500 with this error in console. [2021-12-08 ...
Read more >Strapi v4, No relation fields in User collection types
I am trying to add some relation fields to my. User (collection types, default strapi collection). I created new collection types called ...
Read more >Many-to-many query not populating relation - Strapi Backend
I've noticed that when creating a many-to-many relationship through the content manager UI, it creates two tables, e.g. shoes_sizes_links and ...
Read more >Strapi Populate not working - Discussions
Hi all - I am struggling to find a solution for my API data. My design is that “Albums” have a one-to-many relationship...
Read more >api/users endpoint is not sending relations and media fields
I just found the answer guys, there is a bug in the roles & permissions plugin related to population. There is an issue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It was working. I mistook useOne for useMany on the real/original hook.
Uhmm I’ll check it tomorrow but I created requests for unit tests and it looked correct. Thank you!
https://github.com/pankod/refine/blob/next/packages/strapi-v4/test/dataProvider/index.mock.ts#L858