Calling wrong api end point
HI
I had a symfony app, so I added APIResource on entity. Now I API's are working perfectly. But Client generated app for react is always calling wrong API.
For example:
If I have a resource faq. It is supposed to call http://localhost:8000/api/faqs but it's calling http://localhost:8000/faqs.
In my entrypoint.js I have Base URL as http://localhost:8000/api
What's getting wrong there?
Thanks
Looks related to #107. Can you try to set http://localhost:8000/api/ (with a trailing slash) as base url?
It should be fixed by https://github.com/api-platform/client-generator/blob/master/src/index.js#L51-L53 but it doesn't seem to work properly.
exactly. I am scratching my head since 3 days. and URL's are not working properly.
Does adding the trailing slash in entrypoint.js fixes the problem?
yes. Works perfectly. Then why it generated by default without /
It’s definitely a bug. A patch would be very appreciated!
A fix could be made by generalizing the change made in #115 (currently done for the VueJS part only)
It should be handled in the generator, not in the generated code.
I'm a bit confused by the timeline but it has been fixed in this PR