Design comparison
Solution retrospective
Hi,
I would like to know if any of you guys have any idea how to get border countries' names? I was trying but in the end, I gave up and only displayed alpha3Code.
Thanks!
Community feedback
- @JasM-DevPosted almost 3 years ago
Hi I had the same problem and got really stuck on it for a while. First I did a check after my initial fetch request for the country that was clicked to see if it had a border property. If it does have a border property the value of it will be an array and you can make another fetch request to
https://restcountries.com/v3/alpha?codes=[borders]
and it will return all of the data for those countries that are in that array. Hope this helps!Marked as helpful2@kremenovicPosted almost 3 years ago@jmcollins414 Hi, thank you so much! I'm gonna try that. Thanks again.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord