Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the usage of populate in the case of multiple nested fields to populate #145

Open
iDommel opened this issue Dec 29, 2022 · 0 comments

Comments

@iDommel
Copy link

iDommel commented Dec 29, 2022

It would be nice to have a few lines of documentation showing that you should use spaces when you want to populate multiple nested fields.

When you have a request that looks like:
/orders/${id}?populate=quotation.customer,quotation.quotlines,movements

you end up with a populate object that looks like:
population [ { path: 'quotation', populate: { path: 'quotlines' } }, { path: 'movements' } ]
Instead of :
population [ { path: 'quotation', populate: [{ path: 'quotlines' }, { path: 'customer' }] }, { path: 'movements' } ]

The solution to that is that your request should be made using spaces for consecutive fields from the same key, like so:
/orders/${id}?populate=quotation.customer quotlines,movements

That solution was provided by a veteran user from my team, but it would be nice for it to be documented in the readMe in the populate section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant