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
+7 -1
View File
@@ -17,7 +17,13 @@ export async function GET(
with: {
client: true,
business: true,
items: { orderBy: (i, { asc }) => [asc(i.position)] },
items: {
orderBy: (i, { asc }) => [
asc(i.date),
asc(i.position),
asc(i.createdAt),
],
},
},
});
@@ -320,6 +320,7 @@ export function InvoicesDataTable({ invoices }: InvoicesDataTableProps) {
data={invoices}
searchKey="invoiceNumber"
searchPlaceholder="Search invoices..."
initialSorting={[{ id: "issueDate", desc: true }]}
filterableColumns={filterableColumns}
onRowClick={(invoice) =>
router.push(`/dashboard/invoices/${invoice.id}`)