diff --git a/src/views/address-check.vue b/src/views/address-check.vue index 733b931..4172107 100644 --- a/src/views/address-check.vue +++ b/src/views/address-check.vue @@ -9,6 +9,10 @@ + +
@@ -17,7 +21,8 @@ - @@ -87,14 +93,15 @@ export default { searchResults: [], isSearching: false, isChecking: false, + geolocation: true, addressBook: [], isConnected: null, - currentBtSearch : null + currentBtSearch: null } }, methods: { - useAddressBook(address,i) { - this.currentBtSearch = 'addressBook'+i + useAddressBook(address, i) { + this.currentBtSearch = 'addressBook' + i this.store.setStreet(address.street) this.store.setZipCode(address.zip_code) @@ -132,7 +139,9 @@ export default { + '&zip_code=' + this.store.zipCode + '&city=' + this.store.city - + if (import.meta.env.DEV) { + console.log(urlApi) + } let productList = await fetch(urlApi) .then(response => { if (response.ok) { @@ -143,14 +152,17 @@ export default { this.isChecking = false - if (productList.length > 0) { + if (productList.hasOwnProperty('data') && productList.data.result === 'KO') { + this.geolocation = false + this.noOfferFound = false + } else if (productList.length > 0) { this.store.setProductList(productList); this.$router.push({path: '/delivery-option-step-1'}); } else { this.noOfferFound = true + this.geolocation = true } - } }, async mounted() { diff --git a/src/views/delivery-option-summary.vue b/src/views/delivery-option-summary.vue index ea21ff6..417cb85 100644 --- a/src/views/delivery-option-summary.vue +++ b/src/views/delivery-option-summary.vue @@ -11,7 +11,7 @@ - Ajouter au panier + Confirmer