fix: NaN-Fallback für limit/offset bei ungültigem URL-Parameter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 08:14:47 +02:00
parent 40bf029fc9
commit 070ea75369
+2 -2
View File
@@ -29,8 +29,8 @@ export async function GET(request: NextRequest) {
if (!session) return NextResponse.json({ error: 'Nicht angemeldet' }, { status: 401 });
const { searchParams } = new URL(request.url);
const kuppel = searchParams.get('kuppel') || 'West';
const limit = Math.min(parseInt(searchParams.get('limit') || '10'), 100);
const offset = Math.max(0, parseInt(searchParams.get('offset') || '0'));
const limit = Math.min(parseInt(searchParams.get('limit') || '10') || 10, 100);
const offset = Math.max(0, parseInt(searchParams.get('offset') || '0') || 0);
const month = searchParams.get('month') || '';
let listWhere = 'WHERE l.Kuppel = ?';