TypeScript 50.6%
JavaScript 46.1%
SQL 2.1%
Shell 0.6%
CSS 0.5%
1import { redirect } from "next/navigation";2import { requireUser } from "@/lib/auth/session";3import { createListing } from "@/lib/listings/service";4export const dynamic = "force-dynamic";5/** Crée immédiatement un brouillon puis ouvre le wizard : le brouillon est sauvegardé à chaque étape. */6export default async function Nouvelle({ searchParams }: { searchParams: Promise<{ type?: string; bien?: string }> }) {7 const u = await requireUser(); const sp = await searchParams;8 const l = await createListing(u.id, { listingType: sp.type === "RENT" ? "RENT" : sp.type === "SALE" ? "SALE" : undefined, propertyType: (["appartement", "condo", "maison", "jumele", "plex", "chalet", "terrain", "commercial", "autre"] as const).find((x) => x === sp.bien), wizardStep: sp.type ? 1 : 0 });9 redirect(`/membre/annonces/${l.id}`);10}11