From 0a992094cf6db0f9aab26a82e67eb387b7c77465 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 13 May 2025 14:07:10 +0200 Subject: [PATCH] refactor: refs #8388 optimize expense fetching logic in columns computation --- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index 6f04a5415..38e639f46 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -55,15 +55,9 @@ const columns = computed(() => [ if (evt.key !== 'Tab') return; const val = evt.target.value; if (!val || isNaN(val)) return; - row.expenseFk = ( - await axios.get(`Expenses`, { - params: { - filter: JSON.stringify({ - where: { id: useAccountShortToStandard(val) }, - }), - }, - }) - ).data[0].id; + row.expenseFk = expenses.value.find( + (e) => e.id === useAccountShortToStandard(val), + )?.id; }, }, },