V1.2.0 deploy.sh angepasst

try/catch be SQL-Abfragen
This commit is contained in:
rxf
2026-03-15 13:56:16 +01:00
parent 7da9e27687
commit 23ac4ed8d7
5 changed files with 40 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ export async function GET(req: NextRequest) {
const sord = searchParams.get('sord') === 'asc' ? 'ASC' : 'DESC';
const col = `\`${sidx}\``;
try {
const [rows] = await pool.query<RowDataPacket[]>(
`SELECT tab, pday, cnt, at, akt, until, warn, rem, \`order\`
FROM tabletten
@@ -48,6 +49,10 @@ export async function GET(req: NextRequest) {
};
return NextResponse.json(result);
} catch (err) {
console.error('[GET /api/data]', err);
return NextResponse.json({ error: String(err) }, { status: 500 });
}
}
// POST /api/data