diff --git a/components/SearchInput.vue b/components/SearchInput.vue index e3b4a1a..8b1d1e4 100644 --- a/components/SearchInput.vue +++ b/components/SearchInput.vue @@ -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 }) => { diff --git a/layouts/default.vue b/layouts/default.vue index 2d12356..d2e1860 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -7,9 +7,7 @@ >