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

Duplicated slug for laitdevache #780

Open
Flaburgan opened this issue Mar 6, 2025 · 0 comments
Open

Duplicated slug for laitdevache #780

Flaburgan opened this issue Mar 6, 2025 · 0 comments

Comments

@Flaburgan
Copy link

Hello,
I had a bug in my app using the API because the route returning the drinks https://impactco2.fr/api/v1/thematiques/ecv/3?detail=0&language=fr is returning two items with the slug set to laitdevache, one with an ecv of 0.1505 and one with an ecv of 1.33. This is crashing my app as I use slugs as the unique ID.

I indeed find this laitdevache being defined twice in your data, once in boisson.json and once in alimentation.json, but I would have expect the drink route to not include the item from the alimentation.json (although I see there that it has the category set to 3, so I guess that's why it is included in this route).

In any case, I think it would be better to have the slug unique in the whole app, so I would suggest to remove the definition of laitdevache in the alimentation.json file. I initially did that in an MR but then I realized it is loaded in alimentation.ts so I guess it's better if you do it.

Thanks for your work!

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

No branches or pull requests

1 participant