refactor: extract signals filter builder, add ESLint 10 config, fix low-hanging issues

This commit is contained in:
Sebastian Seedorf
2026-06-04 14:09:12 +02:00
parent cf9bb33ecb
commit 4b05f2968e
34 changed files with 2145 additions and 188 deletions

View File

@@ -1,11 +1,14 @@
import { NextRequest, NextResponse } from 'next/server';
import { getSessionBoundaries } from '@/lib/sessions';
import { type NextRequest, NextResponse } from 'next/server';
import { withAuth } from '@/lib/apiHelpers';
import { getSessionBoundaries } from '@/lib/sessions';
export const GET = withAuth(async (req: NextRequest) => {
const p = req.nextUrl.searchParams;
const from = p.get('from') ? new Date(p.get('from')!) : new Date(Date.now() - 86_400_000);
const to = p.get('to') ? new Date(p.get('to')!) : new Date();
const fromVal = p.get('from');
const toVal = p.get('to');
const from = fromVal ? new Date(fromVal) : new Date(Date.now() - 86_400_000);
const to = toVal ? new Date(toVal) : new Date();
const boundaries = await getSessionBoundaries(from, to);
return NextResponse.json(boundaries);
});