refactor: edit typo addressStore

This commit is contained in:
Thanaphon Frappet 2024-11-14 14:51:40 +07:00
parent fcb4c4a5f8
commit d764650b63

View file

@ -34,7 +34,7 @@ defineProps<{
useWorkPlace?: boolean;
}>();
const adrressStore = useAddressStore();
const addressStore = useAddressStore();
const workplace = defineModel<string>('workplace', { default: '' });
const workplaceEN = defineModel<string>('workplaceEn', { default: '' });
const address = defineModel('address', { default: '' });
@ -81,6 +81,8 @@ const addrOptions = reactive<{
const { t } = useI18n();
const area = computed(() => {});
const fullAddress = computed(() => {
const province = provinceOptions.value.find((v) => v.id === provinceId.value);
const district = districtOptions.value.find((v) => v.id === districtId.value);
@ -135,7 +137,7 @@ const fullAddressEN = computed(() => {
});
async function fetchProvince() {
const result = await adrressStore.fetchProvince();
const result = await addressStore.fetchProvince();
if (result) addrOptions.provinceOps = result;
@ -155,7 +157,7 @@ async function fetchProvince() {
async function fetchDistrict() {
if (!provinceId.value) return;
const result = await adrressStore.fetchDistrictByProvinceId(provinceId.value);
const result = await addressStore.fetchDistrictByProvinceId(provinceId.value);
if (result) addrOptions.districtOps = result;
districtFilter = selectFilterOptionRefMod(
@ -173,7 +175,7 @@ async function fetchDistrict() {
async function fetchSubDistrict() {
if (!districtId.value) return;
const result = await adrressStore.fetchSubDistrictByProvinceId(
const result = await addressStore.fetchSubDistrictByProvinceId(
districtId.value,
);
if (result) addrOptions.subDistrictOps = result;