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

API is not supported anymore #27

Merged
merged 1 commit into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default {
border: 0;
background-color: inherit;
color: inherit;
width: 80%;
outline: 0;
}

@media (min-width: 660px) {
Expand Down
6 changes: 3 additions & 3 deletions src/views/CountryPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export default {

onMounted(async () => {
try {
const countryResponse = await fetch(`https://restcountries.eu/rest/v2/name/${props.name}?fields=name;nativeName;population;region;subregion;capital;topLevelDomain;currencies;languages;borders;flag`)
const countryResponse = await fetch(`https://restcountries.com/v2/name/${props.name}?fields=name,nativeName,population,region,subregion,capital,topLevelDomain,currencies,languages,borders,flag`)
country.value = await countryResponse.json()
country.value = country.value[0]
alpha3Codes.value = country.value.borders.join(';')
alpha3Codes.value = country.value.borders.join(',')

const bordersResponse = await fetch(`https://restcountries.eu/rest/v2/alpha?codes=${alpha3Codes.value}`)
const bordersResponse = await fetch(`https://restcountries.com/v2/alpha?codes=${alpha3Codes.value}`)
borderCountries.value = await bordersResponse.json()
} catch(e) {
error.value = e
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {

onMounted(async () => {
try {
const res = await fetch('https://restcountries.eu/rest/v2/all?fields=name;capital;region;population;flag;alpha3Code')
const res = await fetch('https://restcountries.com/v2/all?fields=name,capital,region,population,flag,alpha3Code')
countries.value = await res.json()
} catch(e) {
error.value = e
Expand Down