MartinsOnuoha / countriesNowAPI

CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
http://countriesnow.space
MIT License
185 stars 59 forks source link

Issue with Uppercase countries #12

Closed iambenkay closed 4 years ago

iambenkay commented 4 years ago

This is small but I think it would make the experience better. In the docs where we get country position by name, where we send a POST Request to /api/v1.0/countries/positions with the country parameter in the body, I noticed that you capitalized it but in reality it doesn't return any data. I also tried with non-existent country names and it kept returning the same strings. For a moment there I thought the API was broken. So I took a look at https://github.com/MartinsOnuoha/countriesAndCitiesAPI/blob/1742ee9dd6c34bb306aac8a1c9f0304e6d190d60/controllers/countryController.js#L90 and found out that you weren't formatting the input to lowercase just the data from the model. Also I think it should fail when a non-existent country is sent. I could make a PR with the suggested changes if you want.

MartinsOnuoha commented 4 years ago

@iambenkay Thanks for pointing out this issue, feel free to send in a PR, we'll review and merge ASAP