|
|
|
@ -174,21 +174,21 @@ export default {
|
|
|
|
|
if (!name.length) {
|
|
|
|
|
this.data = []
|
|
|
|
|
}
|
|
|
|
|
// this.isFetching = true
|
|
|
|
|
// axios
|
|
|
|
|
// .get(`https://demo.addok.xyz/search/?q=${name}`)
|
|
|
|
|
// .then(({ data }) => {
|
|
|
|
|
// console.log('data', data)
|
|
|
|
|
// this.data = []
|
|
|
|
|
// data.results.forEach((item) => this.data.push(item))
|
|
|
|
|
// })
|
|
|
|
|
// .catch((error) => {
|
|
|
|
|
// this.data = []
|
|
|
|
|
// throw error
|
|
|
|
|
// })
|
|
|
|
|
// .finally(() => {
|
|
|
|
|
// this.isFetching = false
|
|
|
|
|
// })
|
|
|
|
|
this.isFetching = true
|
|
|
|
|
this.$axios
|
|
|
|
|
.get(`https://api-adresse.data.gouv.fr/search?&type=poi&q=${name}`)
|
|
|
|
|
.then(({ data }) => {
|
|
|
|
|
console.log('data', data)
|
|
|
|
|
this.data = []
|
|
|
|
|
data.results.forEach((item) => this.data.push(item))
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
this.data = []
|
|
|
|
|
throw error
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.isFetching = false
|
|
|
|
|
})
|
|
|
|
|
// axios
|
|
|
|
|
// .get(`https://api.openstreetmap.org/api/0.6/node/6126513555`)
|
|
|
|
|
// .then(({ data }) => {
|
|
|
|
|