Skip to content

Commit

Permalink
Merge pull request #232 from amansinghbais/154-shipping-address-fix
Browse files Browse the repository at this point in the history
Improved: made zipCode mandatory, hide contact number prefix when no countryCode is selected (#154)
  • Loading branch information
ymaheshwari1 authored Mar 29, 2024
2 parents 9dc1fef + 93a4e95 commit 125b7c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/FacilityAddressModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</ion-select>
</ion-item>
<ion-item>
<ion-label position="floating">{{ translate("Zipcode") }}</ion-label>
<ion-label position="floating">{{ translate("Zipcode") }} <ion-text color="danger">*</ion-text></ion-label>
<ion-input v-model="address.postalCode" />
</ion-item>
<ion-item-divider color="light">
Expand All @@ -55,7 +55,7 @@
<ion-item>
<ion-label :position="telecomNumberValue?.countryCode ? 'stacked' : 'floating'">{{ translate("Contact number") }}</ion-label>
<ion-input v-model="telecomNumberValue.contactNumber">
<ion-text>{{ `${telecomNumberValue?.countryCode}-` }}</ion-text>
<ion-text v-if="telecomNumberValue?.countryCode">{{ `${telecomNumberValue.countryCode}-` }}</ion-text>
</ion-input>
</ion-item>
</form>
Expand Down Expand Up @@ -154,7 +154,7 @@ export default defineComponent({
async saveContact() {
let resp, postalAddress = '';
if(!this.address?.address1 || !this.address?.city) {
if(!this.address?.address1 || !this.address?.city || !this.address?.postalCode) {
showToast("Please fill all the required fields.")
return
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/AddFacilityAddress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ion-item>
<ion-item>
<ion-label position="floating">
{{ translate('Zipcode') }}
{{ translate('Zipcode') }} <ion-text color="danger">*</ion-text>
</ion-label>
<ion-input v-model="formData.postalCode" />
</ion-item>
Expand All @@ -66,7 +66,7 @@
<ion-item lines="none">
<ion-label :position="countryCode ? 'stacked' : 'floating'">{{ translate("Contact number") }}</ion-label>
<ion-input v-model="contactNumber">
<ion-text>{{ `${countryCode}-` }}</ion-text>
<ion-text v-if=countryCode>{{ `${countryCode}-` }}</ion-text>
</ion-input>
</ion-item>
</ion-list>
Expand Down Expand Up @@ -198,7 +198,7 @@ export default defineComponent({
methods: {
async addAddress() {
let resp;
if (!this.formData.address1 || !this.formData.city) {
if (!this.formData.address1 || !this.formData.city || !this.formData.postalCode) {
showToast("Please fill all the required fields.")
return
}
Expand Down

0 comments on commit 125b7c5

Please sign in to comment.