api-platform
api-platform copied to clipboard
what is the best way to add current user information related to GetCollection request
what is the best way to add current user information related to GetCollection request without losing pagination and filters
example request for a list of articles and I want to add the current user information if this article is saved or not
I would add a new field to the response. I haven't been using apiplatform for a while but I believe this can be achieved via custom normalizer that get a user from the token and adds new field with expected data.
P.S. This is not an issue but a discussion.
@javaDeveloperKid have you thought about how many items I would have to go through to fill this new field?
What do you mean by "how many items I would have to go through"? The collection for the resource is added by another normalizer.
That seems like a simple custom state provider to me...?
@mrossard what if your provider gives you a Paginator? how do you change this custom field