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

Ability to send populate field on update request #292

Open
TJacoob opened this issue Nov 9, 2022 · 0 comments
Open

Ability to send populate field on update request #292

TJacoob opened this issue Nov 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@TJacoob
Copy link

TJacoob commented Nov 9, 2022

I'm implementing a simple profile page, and when I update a collection entry, I don't receive its component field. When I first fetch the entry I pass populate as a parameter in the find request, but it's not possible to receive the updated entry with this field in the update response.

I think it would make sense to be able to pass parameters (as it's done in the find request) to other requests such as update.

I understand it's possible to just redo the find request to fetch the updated version of the entry, but its one more request then necessary.

Right now, you can "force" the populate information alongside the id information in the update request, as such:
const updateQuery = await update('profiles', profile.id+'?populate[0]=componentfield', formdata);
but this is a poor solution in my opinion.

The behavior I'm trying to implement is described rather well in this stackoverflow answer: https://stackoverflow.com/a/70640157/3503730

@TJacoob TJacoob added the enhancement New feature or request label Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant