Automattic / isolated-block-editor

Repackages Gutenberg's editor playground as a full-featured multi-instance editor that does not require WordPress.
344 stars 50 forks source link

Question about the feature "Re-routing of WordPress API requests" #175

Closed adrianhm13 closed 2 years ago

adrianhm13 commented 2 years ago

Hey folks!

I've seen that in the isolated block editor's features there is this feature, "Re-routing of WordPress API requests". The thing is that I'd like to reroute the requests made by some of the components to match them with the backend. So far I just been successful with the root URL from apiFetch.createRootURLMiddleware.

I'll try to explain myself as best as possible with this example:

I insert the Image block with a URL: image

Everything works just as expected, but the moment I click "Replace" or "Upload external image" the block breaks. image

Another example, this time one that requires an API call (tag component): image

Here, as my understanding it makes the API call with a path defined by the tags block, how it would be possible to reroute this path?

Any help's more than welcomed,

Thanks a lot!