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

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

export async function GET(req: NextRequest) {
  const qs = req.nextUrl.searchParams.toString()
  const res = await fetch(`${LEGAL_SERVICE}/trust/accounts${qs ? `?${qs}` : ''}`, { cache: 'no-store' })
  const data = await res.json()
  return NextResponse.json(data, { status: res.status })
}
