feat(address): remove ',' and use addressFormat on BasicInformation(customer employee)
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 8s
This commit is contained in:
parent
174c30875e
commit
80f68cd702
2 changed files with 56 additions and 22 deletions
|
|
@ -19,34 +19,34 @@ export function formatAddress(opt: {
|
|||
let addressParts: string[];
|
||||
if (opt.en) {
|
||||
// en
|
||||
addressParts = [`${opt.addressEN},`];
|
||||
if (opt.mooEN) addressParts.push(`Moo ${opt.mooEN},`);
|
||||
if (opt.soiEN) addressParts.push(`Soi ${opt.soiEN},`);
|
||||
addressParts = [`${opt.addressEN}`];
|
||||
if (opt.mooEN) addressParts.push(`Moo ${opt.mooEN}`);
|
||||
if (opt.soiEN) addressParts.push(`Soi ${opt.soiEN}`);
|
||||
if (opt.streetEN) addressParts.push(`${opt.streetEN} Rd.`);
|
||||
|
||||
if (opt.subDistrict) {
|
||||
addressParts.push(`${opt.subDistrict.nameEN} sub-district,`);
|
||||
addressParts.push(`${opt.subDistrict.nameEN} sub-district`);
|
||||
}
|
||||
if (opt.district) addressParts.push(`${opt.district.nameEN} district,`);
|
||||
if (opt.province) addressParts.push(`${opt.province.nameEN},`);
|
||||
if (opt.district) addressParts.push(`${opt.district.nameEN} distric`);
|
||||
if (opt.province) addressParts.push(`${opt.province.nameEN}`);
|
||||
} else {
|
||||
// th
|
||||
addressParts = [`${opt.address},`];
|
||||
if (opt.moo) addressParts.push(`หมู่ ${opt.moo},`);
|
||||
if (opt.soi) addressParts.push(`ซอย ${opt.soi},`);
|
||||
if (opt.street) addressParts.push(`ถนน${opt.street},`);
|
||||
addressParts = [`${opt.address}`];
|
||||
if (opt.moo) addressParts.push(`หมู่ ${opt.moo}`);
|
||||
if (opt.soi) addressParts.push(`ซอย ${opt.soi}`);
|
||||
if (opt.street) addressParts.push(`ถนน${opt.street}`);
|
||||
|
||||
if (opt.subDistrict) {
|
||||
addressParts.push(
|
||||
`${opt.province?.id === '10' ? 'แขวง' : 'ตำบล'}${opt.subDistrict.name},`,
|
||||
`${opt.province?.id === '10' ? 'แขวง' : 'ตำบล'}${opt.subDistrict.name}`,
|
||||
);
|
||||
}
|
||||
if (opt.district) {
|
||||
addressParts.push(
|
||||
`${opt.province?.id === '10' ? 'เขต' : 'อำเภอ'}${opt.district.name},`,
|
||||
`${opt.province?.id === '10' ? 'เขต' : 'อำเภอ'}${opt.district.name}`,
|
||||
);
|
||||
}
|
||||
if (opt.province) addressParts.push(`จังหวัด${opt.province.name},`);
|
||||
if (opt.province) addressParts.push(`จังหวัด${opt.province.name}`);
|
||||
// addressParts.push(
|
||||
// `${opt.province.id === '10' ? t('address.subArea') : t('address.subDistrict')}${opt.subDistrict.name},`,
|
||||
// );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue