import { NextResponse } from "next/server";
import { previewPlanDeletion } from "@/lib/services/propertyDeletion";

export async function POST(
  _req: Request,
  context: { params: Promise<{ id: string }> }
) {
  const { id } = await context.params; // 👈 THIS IS THE FIX
  const planId = Number(id);
  const preview = await previewPlanDeletion(planId);

  return NextResponse.json({ preview });
}
