fix: sort chronologically

This commit is contained in:
2026-06-12 00:11:00 -04:00
parent 94e0a18bf5
commit 190fbd433b
8 changed files with 74 additions and 12 deletions
+5 -1
View File
@@ -105,7 +105,11 @@ export const dashboardRouter = createTRPCRouter({
// Recent Activity
const recentInvoices = await ctx.db.query.invoices.findMany({
where: eq(invoices.createdById, userId),
orderBy: [desc(invoices.issueDate)],
orderBy: [
desc(invoices.issueDate),
desc(invoices.dueDate),
desc(invoices.invoiceNumber),
],
limit: 5,
with: {
client: {