diff --git a/src/components/FacilityGeoPointModal.vue b/src/components/FacilityGeoPointModal.vue index da348f0..51cd9ac 100644 --- a/src/components/FacilityGeoPointModal.vue +++ b/src/components/FacilityGeoPointModal.vue @@ -100,10 +100,13 @@ export default defineComponent({ }, async generateLatLong() { this.isGeneratingLatLong = true + const postalCode = this.geoPoint.postalCode; + const query = postalCode.startsWith('0') ? `${postalCode} OR ${postalCode.substring(1)}` : postalCode; + const payload = { json: { params: { - q: `postcode: ${this.geoPoint.postalCode}` + q: `postcode: ${query}` } } } diff --git a/src/components/GeoPointPopover.vue b/src/components/GeoPointPopover.vue index dc659a8..196236e 100644 --- a/src/components/GeoPointPopover.vue +++ b/src/components/GeoPointPopover.vue @@ -48,10 +48,13 @@ export default defineComponent({ emitter.emit('presentLoader') try { + const postalCode = this.postalAddress.postalCode; + const query = postalCode.startsWith('0') ? `${postalCode} OR ${postalCode.substring(1)}` : postalCode; + resp = await UtilService.generateLatLong({ json: { params: { - q: `postcode: ${this.postalAddress.postalCode}` + q: `postcode: ${query}` } } }) diff --git a/src/views/AddFacilityAddress.vue b/src/views/AddFacilityAddress.vue index 64ca037..1c1188e 100644 --- a/src/views/AddFacilityAddress.vue +++ b/src/views/AddFacilityAddress.vue @@ -200,10 +200,13 @@ export default defineComponent({ if(this.contactNumber) this.saveTelecomNumber() }, async generateLatLong() { + const postalCode = this.formData.postalCode; + const query = postalCode.startsWith('0') ? `${postalCode} OR ${postalCode.substring(1)}` : postalCode; + const payload = { json: { params: { - q: `postcode: ${this.formData.postalCode}` + q: `postcode: ${query}` } } } diff --git a/src/views/FacilityDetails.vue b/src/views/FacilityDetails.vue index 7b6fe69..bf111f8 100644 --- a/src/views/FacilityDetails.vue +++ b/src/views/FacilityDetails.vue @@ -1209,7 +1209,9 @@ export default defineComponent({ const resp = await UtilService.generateLatLong(payload) if(!hasError(resp)) { - this.isRegenerationRequired = !(this.postalAddress.postalCode === resp.data.response.docs[0].postcode) + const postalCode = this.postalAddress.postalCode + const fetchedPostcode = resp.data.response.docs[0].postcode + this.isRegenerationRequired = !(postalCode.startsWith('0') ? postalCode.substring(1) === fetchedPostcode || postalCode === fetchedPostcode : postalCode === fetchedPostcode); } else { throw resp.data }