refactor: zipCode now pull from subDistrict
This commit is contained in:
parent
408b7b3441
commit
251c460787
1 changed files with 10 additions and 10 deletions
|
|
@ -103,14 +103,6 @@ async function fetchSubDistrict() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function selectSubDistrict(id: string) {
|
|
||||||
if (!id) return;
|
|
||||||
zipCode.value =
|
|
||||||
addrOptions.subDistrictOps
|
|
||||||
?.filter((x) => x.id === id)
|
|
||||||
.map((x) => x.zipCode)[0] ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
const provinceOptions = ref<Record<string, unknown>[]>([]);
|
const provinceOptions = ref<Record<string, unknown>[]>([]);
|
||||||
let provinceFilter: (
|
let provinceFilter: (
|
||||||
value: string,
|
value: string,
|
||||||
|
|
@ -383,7 +375,11 @@ watch(districtId, fetchSubDistrict);
|
||||||
readonly
|
readonly
|
||||||
:label="$t('zipCode')"
|
:label="$t('zipCode')"
|
||||||
class="col-md-2 col-6"
|
class="col-md-2 col-6"
|
||||||
v-model="zipCode"
|
:model-value="
|
||||||
|
addrOptions.subDistrictOps
|
||||||
|
?.filter((x) => x.id === subDistrictId)
|
||||||
|
.map((x) => x.zipCode)[0] ?? ''
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -572,7 +568,11 @@ watch(districtId, fetchSubDistrict);
|
||||||
zip="zip-en"
|
zip="zip-en"
|
||||||
:label="$t('zipCode')"
|
:label="$t('zipCode')"
|
||||||
class="col-md-2 col-6"
|
class="col-md-2 col-6"
|
||||||
v-model="zipCode"
|
:model-value="
|
||||||
|
addrOptions.subDistrictOps
|
||||||
|
?.filter((x) => x.id === subDistrictId)
|
||||||
|
.map((x) => x.zipCode)[0] ?? ''
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue