fix: address form zip code in full address

This commit is contained in:
puriphatt 2024-09-18 11:42:15 +07:00
parent 7ecd6d4002
commit 26b6c07368

View file

@ -83,13 +83,14 @@ const fullAddress = computed(() => {
if (districtId.value && district) if (districtId.value && district)
addressParts.push(typeof district.name === 'string' ? district.name : ''); addressParts.push(typeof district.name === 'string' ? district.name : '');
if (provinceId.value && province) if (provinceId.value && province) {
addressParts.push( addressParts.push(
typeof province.name === 'string' ? `${province.name}` : '', typeof province.name === 'string' ? `${province.name}` : '',
); );
sDistrict &&
if (zipCode.value) { addressParts.push(
addressParts.push(zipCode.value); typeof sDistrict.zipCode === 'string' ? `${sDistrict.zipCode}` : '',
);
} }
return addressParts.join(' '); return addressParts.join(' ');
@ -118,13 +119,14 @@ const fullAddressEN = computed(() => {
typeof district.nameEN === 'string' ? district.nameEN : '', typeof district.nameEN === 'string' ? district.nameEN : '',
); );
if (provinceId.value && province) if (provinceId.value && province) {
addressParts.push( addressParts.push(
typeof province.nameEN === 'string' ? `${province.nameEN}` : '', typeof province.nameEN === 'string' ? `${province.nameEN}` : '',
); );
sDistrict &&
if (zipCode.value) { addressParts.push(
addressParts.push(zipCode.value); typeof sDistrict.zipCode === 'string' ? `${sDistrict.zipCode}` : '',
);
} }
return addressParts.join(' '); return addressParts.join(' ');