V1.0.0 Es funktioniert soweit Alles
This commit is contained in:
@@ -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),
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user