From 6f06a7f71ab67ef7353e805f229252b5f4576be7 Mon Sep 17 00:00:00 2001 From: Fabio Benedetti Date: Tue, 19 Nov 2024 11:50:25 +0100 Subject: [PATCH] add example query (#927) * add example query * prettier-fix --------- Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> --- dashboard/starter-example/app/query/route.ts | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dashboard/starter-example/app/query/route.ts diff --git a/dashboard/starter-example/app/query/route.ts b/dashboard/starter-example/app/query/route.ts new file mode 100644 index 0000000..7810c0e --- /dev/null +++ b/dashboard/starter-example/app/query/route.ts @@ -0,0 +1,26 @@ +// import { db } from "@vercel/postgres"; + +// const client = await db.connect(); + +// async function listInvoices() { +// const data = await client.sql` +// SELECT invoices.amount, customers.name +// FROM invoices +// JOIN customers ON invoices.customer_id = customers.id +// WHERE invoices.amount = 666; +// `; + +// return data.rows; +// } + +export async function GET() { + return Response.json({ + message: + '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 }); + // } +}