| 1234567891011121314151617 |
- import { NextResponse } from 'next/server';
- import { getPnLData } from '@/lib/queries';
- export const dynamic = 'force-dynamic';
- export async function GET() {
- try {
- const { data, metrics } = await getPnLData();
- return NextResponse.json({ data, metrics });
- } catch (err) {
- console.error('PnL API error:', err);
- return NextResponse.json(
- { error: 'Failed to fetch PnL data' },
- { status: 500 },
- );
- }
- }
|