pemedia / payload-visual-editor

Payload CMS plugin which provides a visual live editor directly in the Admin UI. Works for collections and globals. Compatible with any kind of JS/TS based frontend technology.
MIT License
209 stars 10 forks source link

fetchRelation is not respecting custom api routes #18

Closed Void-E closed 1 year ago

Void-E commented 1 year ago

When having the api path on a different route (via payload.config.ts), the fetchRelation method (https://github.com/pemedia/payload-visual-editor/blob/main/src/utils/generateDocument.ts#L30) has a hardcoded path to api.

In my application the path is rewritten to _api to avoid conflicts with NextJS, so the visual editor fails fetching requests.

jpeiniger commented 1 year ago

This should be fixed now. Feel free to try it out @Void-E

Void-E commented 1 year ago

Just downloaded the new release and it works like a charm! Thanks for the quick resolution!