From 1e9e5e647d5bb0af8ea8b89ffd502754cb9ab027 Mon Sep 17 00:00:00 2001
From: jorgep <jorgep@verdnatura.es>
Date: Mon, 24 Feb 2025 10:05:13 +0100
Subject: [PATCH] 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 8d241441d66..7624a3f9835 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) => {