Skip to content

Commit

Permalink
Refactor countries data fetching in index.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBroersma committed Dec 20, 2024
1 parent 69e54d1 commit 6d2f33b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ function isCollectionIntersecting(collection: CollectionType) {
return turf.intersect(collectionBboxPolygon, drawnBboxPolygon) !== null
}
let { data: countries } = await useFetch(
url.protocol + '//' + url.host + '/countries.json',
)
let countries = await $fetch(url.protocol + '//' + url.host + '/countries.json')
console.log(countries, url.protocol + '//' + url.host + '/countries.json')
Expand All @@ -108,7 +106,7 @@ let intersectingCountries = computed(() => {
const drawnPolygon = polygons.value[0]
return countries.value?.features.filter((country) => {
return countries?.features.filter((country) => {
return turf.intersect(drawnPolygon, country.geometry) !== null
})
})
Expand Down

0 comments on commit 6d2f33b

Please sign in to comment.