diff --git a/html/index.html b/html/index.html
index 15583e8..37b6ab6 100644
--- a/html/index.html
+++ b/html/index.html
@@ -273,16 +273,14 @@
},
methods: {
async fetchData() {
- const response = await fetch('https://countriesnow.space/api/v0.1/countries/');
- if(response){
+ const response = await fetch("https://api.sampleapis.com/countries/countries");
+
+ if (response.ok) {
const data = await response.json();
- const result = data.data;
+ const countryNames = data.map((country) => country.name);
+ const result = countryNames.sort((a, b) => a.localeCompare(b));
- const selectDrop = document.getElementById('nationality');
-
- result.forEach(obj => {
- viewmodel.nationalities.push(obj.country);
- });
+ this.nationalities = result;
}
},
click_character: function(idx, type) {
@@ -454,4 +452,4 @@
});
-