import { checkoutTask } from '@/lib/delegation.js';

export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';

export async function POST(req, { params }) {
  const { id } = await params;
  const body = await req.json().catch(() => ({}));
  return Response.json({ task: checkoutTask(id, body) });
}
