From 0087f0b7de6f0ffed7da5942c4aa508c26dd774e Mon Sep 17 00:00:00 2001 From: Simon-Drohsen Date: Tue, 10 Sep 2024 15:37:45 +0200 Subject: [PATCH] created update Button to get newest Data from Database --- src/App.vue | 17 +++++++++++++++++ src/components/Mapbox.vue | 15 --------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/App.vue b/src/App.vue index c52c9b3..c8243eb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -29,6 +29,7 @@ + @@ -47,6 +48,22 @@ import { Disclosure } from '@headlessui/vue' export default { components: { Disclosure + }, + + methods: { + updateData () { + localStorage.clear() + this.addressesStore.addressItems = [] + this.addressesStore.addressesLoaded = false + this.buildingsStore.buildingItems = [] + this.buildingsStore.buildingsLoaded = false + this.addressesStore.fetchAddresses() + this.buildingsStore.fetchBuildings() + setTimeout(() => { + // eslint-disable-next-line no-self-assign + location.href = location.href + }, 1000) + } } } diff --git a/src/components/Mapbox.vue b/src/components/Mapbox.vue index 0e4f392..cf94192 100644 --- a/src/components/Mapbox.vue +++ b/src/components/Mapbox.vue @@ -1,6 +1,5 @@ @@ -195,20 +194,6 @@ export default { this.map.setFilter('buildings-highlighted', ['in', 'osm_id', '']) }, - updateData () { - localStorage.clear() - setTimeout(() => { - this.addressesStore.fetchAddresses() - this.buildingsStore.fetchBuildings() - console.log(this.addressesStore) - console.log(this.buildingsStore) - setTimeout(() => { - // eslint-disable-next-line no-self-assign - location.href = location.href - }, 1000) - }, 1000) - }, - buildingNotDone () { const index = this.buildingsStore.buildingItems.indexOf(this.buildingsStore.selectedBuilding) this.buildingPartial.push(this.buildingsStore.selectedBuilding.osm_id.toString())