From bd676cc711c72cf425aea5ad7de6a287e002b3a4 Mon Sep 17 00:00:00 2001 From: Net Date: Wed, 14 Aug 2024 16:02:30 +0700 Subject: [PATCH] fix: wrong id --- .../03_customer-management/BranchPage.vue | 22 +++++++++++++++---- src/pages/03_customer-management/MainPage.vue | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/pages/03_customer-management/BranchPage.vue b/src/pages/03_customer-management/BranchPage.vue index d76881c5..7cec2e45 100644 --- a/src/pages/03_customer-management/BranchPage.vue +++ b/src/pages/03_customer-management/BranchPage.vue @@ -62,7 +62,6 @@ const prop = withDefaults( defineProps<{ color?: 'purple' | 'green'; - customerId: string; customerType: CustomerType; }>(), { @@ -70,6 +69,8 @@ const prop = withDefaults( }, ); +const customerId = defineModel('customerId', { required: true }); + defineEmits<{ (e: 'back'): void; (e: 'viewDetail', branch: CustomerBranch, index: number): void; @@ -136,8 +137,10 @@ const branchFieldSelected = ref< >(fieldDisplay.value); async function fetchList() { + if (!customerId.value) return; + const result = await fetchListCustomeBranch({ - customerId: prop.customerId, + customerId: customerId.value, query: !!inputSearch.value ? inputSearch.value : undefined, page: currentPageBranch.value, pageSize: pageSizeBranch.value, @@ -165,7 +168,7 @@ onMounted(async () => { await fetchList(); }); -watch([inputSearch, currentStatus], async () => { +watch([customerId, inputSearch, currentStatus], async () => { await fetchList(); }); @@ -227,7 +230,7 @@ watch([inputSearch, currentStatus], async () => { -
+
{ } " /> + + + + asdadadasd