strapi icon indicating copy to clipboard operation
strapi copied to clipboard

Ability to send populate field on update request

Open TJacoob opened this issue 2 years ago • 0 comments

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 avatar Nov 09 '22 16:11 TJacoob