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:
@@ -29,8 +29,8 @@ export async function GET(request: NextRequest) {
|
|||||||
if (!session) return NextResponse.json({ error: 'Nicht angemeldet' }, { status: 401 });
|
if (!session) return NextResponse.json({ error: 'Nicht angemeldet' }, { status: 401 });
|
||||||
const { searchParams } = new URL(request.url);
|
const { searchParams } = new URL(request.url);
|
||||||
const kuppel = searchParams.get('kuppel') || 'West';
|
const kuppel = searchParams.get('kuppel') || 'West';
|
||||||
const limit = Math.min(parseInt(searchParams.get('limit') || '10'), 100);
|
const limit = Math.min(parseInt(searchParams.get('limit') || '10') || 10, 100);
|
||||||
const offset = Math.max(0, parseInt(searchParams.get('offset') || '0'));
|
const offset = Math.max(0, parseInt(searchParams.get('offset') || '0') || 0);
|
||||||
const month = searchParams.get('month') || '';
|
const month = searchParams.get('month') || '';
|
||||||
|
|
||||||
let listWhere = 'WHERE l.Kuppel = ?';
|
let listWhere = 'WHERE l.Kuppel = ?';
|
||||||
|
|||||||
Reference in New Issue
Block a user