Fix wrong sorting of invoices since lazily loading older years

This commit is contained in:
2025-12-02 18:03:22 +01:00
parent a4466a9d2c
commit 4dbe4f000e
+3
View File
@@ -35,6 +35,9 @@ onMounted(async () => {
try {
const invoiceBeforeThisYearResponse = await axios.get('/api/invoices/summaryBeforeThisYear')
invoicesData.value = invoicesData.value.concat(invoiceBeforeThisYearResponse.data as Invoice[])
invoicesData.value = invoicesData.value.sort(
(a, b) => new Date(a.invoiceDate) - new Date(b.invoiceDate)
)
} catch (error) {
console.error('Fehler beim Laden der Daten:', error)
}