V 2.1.0 Verbesserungen von Claude Code eingeügt

This commit is contained in:
2026-04-27 10:24:29 +02:00
parent e4d771fb65
commit 8e2fa896de
11 changed files with 85 additions and 47 deletions

View File

@@ -12,18 +12,30 @@ export async function PUT(
const { id } = await context.params;
const body: CreateWerteEntry = await request.json();
const sql = `UPDATE ${TABLE} SET
Datum = '${body.Datum}',
Zeit = '${body.Zeit}',
Zucker = ${body.Zucker || 'NULL'},
Essen = ${body.Essen ? `'${body.Essen.replace(/'/g, "''")}'` : 'NULL'},
Gewicht = ${body.Gewicht || 'NULL'},
DruckS = ${body.DruckS || 'NULL'},
DruckD = ${body.DruckD || 'NULL'},
Puls = ${body.Puls || 'NULL'}
WHERE ID = ${parseInt(id, 10)}`;
const result = await query(sql);
const sql = `UPDATE ${TABLE} SET
Datum = ?,
Zeit = ?,
Zucker = ?,
Essen = ?,
Gewicht = ?,
DruckS = ?,
DruckD = ?,
Puls = ?
WHERE ID = ?`;
const params = [
body.Datum,
body.Zeit,
body.Zucker || null,
body.Essen || null,
body.Gewicht ? parseFloat(parseFloat(String(body.Gewicht)).toFixed(1)) : null,
body.DruckS || null,
body.DruckD || null,
body.Puls || null,
parseInt(id, 10),
];
const result = await query(sql, params);
return NextResponse.json({ success: true, data: result });
} catch (error) {
@@ -42,8 +54,8 @@ export async function DELETE(
try {
const { id } = await context.params;
const sql = `DELETE FROM ${TABLE} WHERE ID = ${parseInt(id, 10)}`;
const result = await query(sql);
const sql = `DELETE FROM ${TABLE} WHERE ID = ?`;
const result = await query(sql, [parseInt(id, 10)]);
return NextResponse.json({ success: true, data: result });
} catch (error) {