import { NextRequest, NextResponse } from 'next/server'

const LEGAL_SERVICE = process.env.LEGAL_SERVICE_URL ?? 'http://localhost:3200'

export async function GET(_req: NextRequest, { params }: { params: Promise<{ clientFolderId: string }> }) {
  const { clientFolderId } = await params
  const res = await fetch(`${LEGAL_SERVICE}/trust/accounts/${clientFolderId}`, { cache: 'no-store' })
  const data = await res.json()
  return NextResponse.json(data, { status: res.status })
}
