diff --git a/dashboard/final-example/app/lib/data.ts b/dashboard/final-example/app/lib/data.ts index 9fb3519e..e9a351eb 100644 --- a/dashboard/final-example/app/lib/data.ts +++ b/dashboard/final-example/app/lib/data.ts @@ -40,7 +40,7 @@ export async function fetchLatestInvoices() { SELECT invoices.amount, customers.name, customers.image_url, customers.email, invoices.id FROM invoices JOIN customers ON invoices.customer_id = customers.id - ORDER BY invoices.date DESC + ORDER BY invoices.date DESC, invoices.id LIMIT 5`; const latestInvoices = data.rows.map((invoice) => ({ @@ -116,7 +116,7 @@ export async function fetchFilteredInvoices( invoices.amount::text ILIKE ${`%${query}%`} OR invoices.date::text ILIKE ${`%${query}%`} OR invoices.status ILIKE ${`%${query}%`} - ORDER BY invoices.date DESC + ORDER BY invoices.date DESC, invoices.id LIMIT ${ITEMS_PER_PAGE} OFFSET ${offset} `; diff --git a/dashboard/starter-example/app/lib/data.ts b/dashboard/starter-example/app/lib/data.ts index 4c699a33..f1e6b4bb 100644 --- a/dashboard/starter-example/app/lib/data.ts +++ b/dashboard/starter-example/app/lib/data.ts @@ -38,7 +38,7 @@ export async function fetchLatestInvoices() { SELECT invoices.amount, customers.name, customers.image_url, customers.email, invoices.id FROM invoices JOIN customers ON invoices.customer_id = customers.id - ORDER BY invoices.date DESC + ORDER BY invoices.date DESC, invoices.id LIMIT 5`; const latestInvoices = data.rows.map((invoice) => ({ @@ -112,7 +112,7 @@ export async function fetchFilteredInvoices( invoices.amount::text ILIKE ${`%${query}%`} OR invoices.date::text ILIKE ${`%${query}%`} OR invoices.status ILIKE ${`%${query}%`} - ORDER BY invoices.date DESC + ORDER BY invoices.date DESC, invoices.id LIMIT ${ITEMS_PER_PAGE} OFFSET ${offset} `;