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

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

export async function POST(_req: NextRequest, { params }: { params: Promise<{ id: string }> }) {
  const { id } = await params
  const res = await fetch(`${API}/documents/${id}/translate`, { method: 'POST', cache: 'no-store' })
  return NextResponse.json(await res.json(), { status: res.status })
}
