Skip to content

Commit 6d2f33b

Browse files
Refactor countries data fetching in index.vue
1 parent 69e54d1 commit 6d2f33b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/pages/index.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ function isCollectionIntersecting(collection: CollectionType) {
9696
return turf.intersect(collectionBboxPolygon, drawnBboxPolygon) !== null
9797
}
9898
99-
let { data: countries } = await useFetch(
100-
url.protocol + '//' + url.host + '/countries.json',
101-
)
99+
let countries = await $fetch(url.protocol + '//' + url.host + '/countries.json')
102100
103101
console.log(countries, url.protocol + '//' + url.host + '/countries.json')
104102
@@ -108,7 +106,7 @@ let intersectingCountries = computed(() => {
108106
109107
const drawnPolygon = polygons.value[0]
110108
111-
return countries.value?.features.filter((country) => {
109+
return countries?.features.filter((country) => {
112110
return turf.intersect(drawnPolygon, country.geometry) !== null
113111
})
114112
})

0 commit comments

Comments
 (0)