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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user