DEV Community

Discussion on: My second vanilla JavaScript Project: using APIs, promises, classes, error handling, and more!

Collapse
 
rahulbhooteshwar profile image
Rahul Bhooteshwar • Edited

That's really awesome and a lot of learning stuff here.

Just one thing I noticed (nothing to be offended but I am curious about the same). I tried to add my country India, & saw the following flag for it 👇
dev-to-uploads.s3.amazonaws.com/up...
I believe that's flag for British occupied India(not sure). That's surprisingly shocking, what API is using that flag after the 75years of Independence & so much contribution to world economy , innovation & what not!

I still need to explore the code & API you are using but yeah that's the first thing I noticed as a User.
As mentioned nothing to be offended here or your fault but it's surprising to see who is providing the modern API with modern technology to serve outdated information that too 75 years old!

Collapse
 
kevduc profile image
Kevin Duconge

Damian used restcountries.eu/, but it looks like he used partial matching to get the country flag (restcountries.eu/rest/v2/name/India), which returns the "British Indian Ocean Territory" as a first result when looking for India.
With the "fullText" flag to true for an exact match (restcountries.eu/rest/v2/name/Indi...) it returns the correct result.

Collapse
 
colocodes profile image
Damian Demasi

Exactly! Thanks for this.

Collapse
 
colocodes profile image
Damian Demasi

I noticed that issue with the flag as well. I think that is happening because I'm searching for the first ocurrence of the country name, and that weird "British occupied India" is comming up first. If I have time, I'll fix this in the future.

Thanks for the feedback! 😅

Collapse
 
dannyengelman profile image
Danny Engelman

Maybe use a native web component for flags, flagmeister.github.io