This commit is contained in:
Jonathan Chevalier
2022-11-09 17:40:21 +01:00
parent 8dcd07fce0
commit 7e418a07ee
4 changed files with 21 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ export default {
const store = useMMCMStore()
const noOfferFound = ref(false)
const query = ref(import.meta.env.DEV ? "9 Impasse des Peupliers 13008 Marseill" : '')
const query = ref(store.fullAddress !== null ? store.fullAddress : import.meta.env.DEV ? "9 Impasse des Peupliers 13008 Marseill" : '')
return {
query,
@@ -61,6 +61,11 @@ export default {
},
methods: {
updateSearchResult: async function () {
this.store.setStreet(null)
this.store.setZipCode(null)
this.store.setCity(null)
this.isSearching = true
this.noOfferFound = false
this.searchResults = await fetch('https://api-adresse.data.gouv.fr/search/?q=' + this.query)