feat: Fahrkosten 'Bis Datum' Filter (Default heute) — Version 1.11.0

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 15:42:28 +02:00
parent 7c11683515
commit ba869e373d
4 changed files with 68 additions and 18 deletions
+5 -1
View File
@@ -13,9 +13,13 @@ export async function GET(req: Request) {
if (!ab || !/^\d{4}-\d{2}-\d{2}$/.test(ab)) {
return NextResponse.json({ error: 'Parameter ab (YYYY-MM-DD) fehlt' }, { status: 400 });
}
const bis = searchParams.get('bis') ?? new Date().toISOString().slice(0, 10);
if (!/^\d{4}-\d{2}-\d{2}$/.test(bis)) {
return NextResponse.json({ error: 'Parameter bis (YYYY-MM-DD) ungültig' }, { status: 400 });
}
try {
const rows = await phpdb.getFahrkosten(ab);
const rows = await phpdb.getFahrkosten(ab, bis);
return NextResponse.json(rows);
} catch (error) {
console.error('GET /api/fahrkosten:', error);