From 1e9e5e647d5bb0af8ea8b89ffd502754cb9ab027 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 24 Feb 2025 10:05:13 +0100 Subject: [PATCH 1/2] fix: refs #6919 update customer data retrieval to use useArrayData for improved reactivity --- src/pages/Customer/components/CustomerSamplesCreate.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index 8d241441d..7624a3f98 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -39,7 +39,7 @@ const optionsSamplesVisible = ref([]); const sampleType = ref({ hasPreview: false }); const initialData = reactive({}); const entityId = computed(() => route.params.id); -const customer = computed(() => state.get('Customer')); +const customer = computed(() => useArrayData('Customer').store?.data); const filterEmailUsers = { where: { userFk: user.value.id } }; const filterClientsAddresses = { include: [ @@ -65,9 +65,9 @@ const filterSamplesVisible = { defineEmits(['confirm', ...useDialogPluginComponent.emits]); onBeforeMount(async () => { - initialData.clientFk = customer.value.id; - initialData.recipient = customer.value.email; - initialData.recipientId = customer.value.id; + initialData.clientFk = customer.value?.id; + initialData.recipient = customer.value?.email; + initialData.recipientId = customer.value?.id; }); const setEmailUser = (data) => { From 5e8ad9df11e5550ec4c4345021a374a8ce0409bf Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 24 Feb 2025 10:13:09 +0100 Subject: [PATCH 2/2] feat: refs #6919 add useArrayData import to CustomerSamplesCreate for improved data handling --- src/pages/Customer/components/CustomerSamplesCreate.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Customer/components/CustomerSamplesCreate.vue b/src/pages/Customer/components/CustomerSamplesCreate.vue index 7624a3f98..1294a5d25 100644 --- a/src/pages/Customer/components/CustomerSamplesCreate.vue +++ b/src/pages/Customer/components/CustomerSamplesCreate.vue @@ -18,6 +18,7 @@ import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue'; import FormPopup from 'src/components/FormPopup.vue'; +import { useArrayData } from 'src/composables/useArrayData'; const { dialogRef, onDialogOK } = useDialogPluginComponent();