Closed simonkoehl closed 5 years ago
Result of the upload request doesn't contain an url field but looks like the following:
{
"success": true,
"id": 129765,
"type": "file",
"files": [
{
"location": "https:\/\/assets.serlo.org\/5c596062dd4fc_157398fce371414c1a35e651ca5ae01782d9fa6e.png",
"size": 16978,
"id": 14585,
"type": "image\/png",
"filename": "document-27567_1280.png"
}
]
}
A solution would probably be to pass the handler (e.g.getStateFromResponse
) through upload config and change the mentioned lines to:
onComplete={({ response }: any) => {
const uploaded = config.getStateFromResponse(response)
this.props.onImageUploaded(uploaded)
}
and change ImageUploaded
interface for onImageUploaded to Partial<ImagePluginState>
image upload attempt fails on serlo.org/jobs image does not appear in the content after selecting the image and clicking on upload no helpful information in the console