Ensure the exported data is sorted by the expense date (Fixes #305) (#306)

This commit is contained in:
Allen
2025-04-20 02:22:16 +08:00
committed by GitHub
parent c14c854a79
commit 2fda3e453c

View File

@@ -14,6 +14,7 @@ export async function GET(
currency: true,
expenses: {
select: {
createdAt: true,
expenseDate: true,
title: true,
category: { select: { grouping: true, name: true } },
@@ -23,6 +24,7 @@ export async function GET(
isReimbursement: true,
splitMode: true,
},
orderBy: [{ expenseDate: 'asc' }, { createdAt: 'asc' }],
},
participants: { select: { id: true, name: true } },
},