I want to inject full path to my media in admin of API-platform with following this doc
was impossible to generate full path URI I try this:
field.field = props => (
<ImageField source="contentUrl" {...props} >
<FunctionField render={ render => {
console.log(render)
return `${process.env.REACT_APP_API_ENTRYPOINT}/media/${render.contentUrl}`
}} />
</ImageField>
);
from: this stack
I obtain this result:
<img src="[object Object]" class="ImageField-image-274">
my src needs to be:
http://localhost:8080/media/myFile.jpg
from my api:
contentUrl = myFile.jpg
I need concat this with process.env.REACT_APP_API_ENTRYPOINT
thanks for your help!