V1.0.0 Es funktioniert soweit Alles

This commit is contained in:
2026-02-27 16:41:03 +00:00
parent 14bb3fd2cd
commit 5981a7a6db
4 changed files with 48 additions and 20 deletions

View File

@@ -10,13 +10,20 @@ export async function PUT(
try {
const { id } = await context.params;
const body = await request.json();
const { Datum, Wo, Was, Wieviel, Wie, TYP, OK } = body;
const { Datum, Wo, Was, Wieviel, Wie, TYP } = body;
if (!Datum || !Wo || !Was || !Wieviel || !Wie || TYP === undefined) {
return NextResponse.json(
{ success: false, error: 'Missing required fields' },
{ status: 400 }
);
}
const pool = getDbPool();
const query = `
UPDATE Ausgaben
SET Datum = ?, Wo = ?, Was = ?, Wieviel = ?, Wie = ?, TYP = ?, OK = ?
SET Datum = ?, Wo = ?, Was = ?, Wieviel = ?, Wie = ?, TYP = ?
WHERE ID = ?
`;
@@ -27,7 +34,6 @@ export async function PUT(
parseFloat(Wieviel),
Wie,
TYP,
OK || 0,
parseInt(id),
]);