Dashboard-Ladezeit durch geteilte Datenabfragen optimiert

This commit is contained in:
2026-08-07 19:07:20 +02:00
parent d2e0b4ca0f
commit 9421c3221c
5 changed files with 69 additions and 18 deletions

View File

@@ -17,6 +17,7 @@ const props = defineProps({
})
const tempStore = useTempStore()
const { loadCoreData } = useDashboardData()
const isMounted = ref(false)
const amountMode = ref("net")
@@ -82,10 +83,7 @@ watch([amountMode, granularity, selectedYear, selectedMonth], () => {
})
const loadData = async () => {
const [docs, incoming] = await Promise.all([
useEntities("createddocuments").select(),
useEntities("incominginvoices").select()
])
const { createdDocuments: docs, incomingInvoices: incoming } = await loadCoreData()
incomeDocuments.value = (docs || []).filter((item) => item.state === "Gebucht" && ["invoices", "advanceInvoices", "cancellationInvoices"].includes(item.type))
expenseInvoices.value = (incoming || []).filter((item) => item.state === "Gebucht" && item.date)