leilo
This commit is contained in:
+4
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user