From bae0b4de351f43a65de5b6ef05fbdaa9cd525d7c Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 22 Aug 2024 10:38:15 +0200 Subject: [PATCH] fix: itemBotanical --- src/pages/Item/Card/ItemBotanical.vue | 35 +++++++++++++-------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/pages/Item/Card/ItemBotanical.vue b/src/pages/Item/Card/ItemBotanical.vue index 416c7f78bc..88d251c470 100644 --- a/src/pages/Item/Card/ItemBotanical.vue +++ b/src/pages/Item/Card/ItemBotanical.vue @@ -13,7 +13,6 @@ import CreateSpecieForm from './CreateSpecieForm.vue'; const route = useRoute(); const { t } = useI18n(); -const itemBotanicalsRef = ref(null); const itemGenusOptions = ref([]); const itemSpeciesOptions = ref([]); const itemBotanicals = ref([]); @@ -31,22 +30,19 @@ const onSpecieCreated = (response, formData) => { const entityId = computed(() => { return route.params.id; }); -onMounted(async () => { - itemBotanicalsForm.itemFk = entityId.value; - itemBotanicals.value = await itemBotanicalsRef.value.fetch(); - if (itemBotanicals.value.length > 0) - Object.assign(itemBotanicalsForm, itemBotanicals.value[0]); -}); +// onMounted(async () => { +// itemBotanicalsForm.itemFk = entityId.value; +// // itemBotanicals.value = await itemBotanicalsRef.value.fetch(); +// if (itemBotanicals.value.length > 0) +// Object.assign(itemBotanicalsForm, itemBotanicals.value[0]); +// }); +async function handleItemBotanical(data) { + itemBotanicalsForm = data; + // if (data.length > 0) Object.assign(itemBotanicalsForm, itemBotanicals.value[0]); +}