Fix wrong sorting of invoices since lazily loading older years
This commit is contained in:
@@ -35,6 +35,9 @@ onMounted(async () => {
|
|||||||
try {
|
try {
|
||||||
const invoiceBeforeThisYearResponse = await axios.get('/api/invoices/summaryBeforeThisYear')
|
const invoiceBeforeThisYearResponse = await axios.get('/api/invoices/summaryBeforeThisYear')
|
||||||
invoicesData.value = invoicesData.value.concat(invoiceBeforeThisYearResponse.data as Invoice[])
|
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) {
|
} catch (error) {
|
||||||
console.error('Fehler beim Laden der Daten:', error)
|
console.error('Fehler beim Laden der Daten:', error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user