Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly parse of id with basename name same as resource name #9906

Open
Netail opened this issue Jun 7, 2024 · 1 comment
Open

Incorrectly parse of id with basename name same as resource name #9906

Netail opened this issue Jun 7, 2024 · 1 comment

Comments

@Netail
Copy link

Netail commented Jun 7, 2024

What you were expecting:
When a basename has been set in the <Admin> component and one of the resources has the same name as the basename, it should correctly parse the id for fetching getOne.

/sponsored-recipes/sponsored-recipes/1 should fetch with the following: { resource: "sponsored-recipes", id: "1" }

What happened instead:
Instead it uses the resource name as id for fetching getOne.

/sponsored-recipes/sponsored-recipes/1 will try to fetch with the following: { resource: "sponsored-recipes", id: "sponsored-recipes" }

Steps to reproduce:

  1. Set a basepath with the same name as resource
  2. Open a detail page or even on list page already
  3. Check console

Related code:
Haven't got time for a example yet, can add later if needed

Environment

  • React-admin version: 4.16.18
  • React version: 18.2.0
  • Browser: Chrome
  • Stack trace (in case of a JS error):
@fzaninotto
Copy link
Member

Yes, please add a reproducible example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants