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

@@ -11,6 +11,7 @@ import {
} from "~/composables/useDepreciation"
const loading = ref(true)
const { loadCoreData } = useDashboardData()
const summary = ref({
label: "",
income: 0,
@@ -47,11 +48,11 @@ const loadSummary = async () => {
end: dayjs().endOf("month")
}
const [docs, incoming, allocations] = await Promise.all([
useEntities("createddocuments").select(),
useEntities("incominginvoices").select(),
const [coreData, allocations] = await Promise.all([
loadCoreData(),
useEntities("statementallocations").select("*, bankstatement(*)")
])
const { createdDocuments: docs, incomingInvoices: incoming } = coreData
const outputDocs = (docs || []).filter((doc: any) => {
if (!isRelevantOutputDocument(doc)) {