This commit is contained in:
2026-04-29 12:21:25 +03:00
parent cde1785fc5
commit 922cc1bcfc
+17 -23
View File
@@ -1,26 +1,20 @@
// import postgres from 'postgres'; import postgres from 'postgres';
// const sql = postgres(process.env.POSTGRES_URL!, { ssl: 'require' }); const sql = postgres(process.env.POSTGRES_URL!, { ssl: 'require' });
// async function listInvoices() { async function listInvoices() {
// const data = await sql` const data = await sql`
// SELECT invoices.amount, customers.name SELECT invoices.amount, customers.name
// FROM invoices FROM invoices
// JOIN customers ON invoices.customer_id = customers.id JOIN customers ON invoices.customer_id = customers.id
// WHERE invoices.amount = 666; WHERE invoices.amount = 666;
// `; `;
return data;
// return data; }
// } export async function GET() {
try {
export async function GET() { return Response.json(await listInvoices());
return Response.json({ } catch (error) {
message: return Response.json({ error }, { status: 500 });
'Uncomment this file and remove this line. You can delete this file when you are finished.', }
});
// try {
// return Response.json(await listInvoices());
// } catch (error) {
// return Response.json({ error }, { status: 500 });
// }
} }