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