refactor: extract signals filter builder, add ESLint 10 config, fix low-hanging issues
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import pool from '@/lib/db';
|
||||
import { type NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { withAuth } from '@/lib/apiHelpers';
|
||||
import pool from '@/lib/db';
|
||||
|
||||
export const GET = withAuth(async (req: NextRequest) => {
|
||||
const p = req.nextUrl.searchParams;
|
||||
const combinator = p.get('combinator');
|
||||
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 conditions = ['real_time BETWEEN $1 AND $2'];
|
||||
const values: unknown[] = [from, to];
|
||||
|
||||
Reference in New Issue
Block a user