This commit is contained in:
2026-05-11 17:51:47 +03:00
parent 922cc1bcfc
commit a50e525de1
13 changed files with 4709 additions and 96 deletions
+4 -3
View File
@@ -18,12 +18,12 @@ export async function fetchRevenue() {
// Artificially delay a reponse for demo purposes.
// Don't do this in real life :)
// console.log('Fetching revenue data...');
// await new Promise((resolve) => setTimeout(resolve, 3000));
console.log('Fetching revenue data...');
await new Promise((resolve) => setTimeout(resolve, 3000));
const data = sql<Revenue[]>`SELECT * FROM revenue`;
// console.log('Data fetch complete after 3 seconds.');
console.log('Data fetch complete after 3 seconds.');
return data;
} catch (error) {
@@ -162,6 +162,7 @@ export async function fetchInvoiceById(id: string) {
amount: invoice.amount / 100,
}));
console.log(invoice); // Invoice is an empty array []
return invoice[0];
} catch (error) {
console.error('Database Error:', error);