How can I alter the API response for a component (dynamic zone)

Hi,

I’ve figured out to to alter the response for a content type using a custom controller , but not for a component used in dynamic zone.

Imagine a case where an editor adds a “Latest Products” component to a page, I want to hook into the component response to get the latest products and add them to the API.

If there is another approach I’m missing please let me know!

Many thanks