From a48468ae4597ba6e39119d0fbf390f7506a90208 Mon Sep 17 00:00:00 2001 From: Enguerrand Ozano Date: Sat, 28 Feb 2026 20:00:04 +0100 Subject: [PATCH] Fix params/searchParams types for Next.js app router --- app/{ => (app)}/api/contact/route.ts | 0 app/{ => (app)}/api/devis/route.ts | 0 app/{ => (app)}/assainissement/page.tsx | 0 app/{ => (app)}/blog/[slug]/page.tsx | 0 app/{ => (app)}/blog/page.tsx | 0 app/{ => (app)}/cgv/page.tsx | 0 app/{ => (app)}/confidentialite/page.tsx | 0 .../construction-maison-douai/page.tsx | 0 .../construction-maison-orchies/page.tsx | 0 .../construction-maison-valenciennes/page.tsx | 0 app/{ => (app)}/construction-maison/page.tsx | 0 app/{ => (app)}/contact/page.tsx | 0 app/{ => (app)}/creation-acces/page.tsx | 0 app/{ => (app)}/demolition/page.tsx | 0 app/{ => (app)}/globals.css | 0 app/{ => (app)}/layout.tsx | 0 .../macon-flines-lez-raches/page.tsx | 0 app/{ => (app)}/macon-mouchin/page.tsx | 0 .../macon-saint-amand-les-eaux/page.tsx | 0 app/{ => (app)}/mentions-legales/page.tsx | 0 app/{ => (app)}/page.tsx | 0 app/{ => (app)}/partenaires/page.tsx | 0 app/{ => (app)}/realisations/page.tsx | 0 .../renovation-maison-douai/page.tsx | 0 .../renovation-maison-orchies/page.tsx | 0 app/{ => (app)}/renovation/page.tsx | 0 app/{ => (app)}/services/page.tsx | 0 app/(payload)/layout.tsx | 23 +++++++++++++++++++ 28 files changed, 23 insertions(+) rename app/{ => (app)}/api/contact/route.ts (100%) rename app/{ => (app)}/api/devis/route.ts (100%) rename app/{ => (app)}/assainissement/page.tsx (100%) rename app/{ => (app)}/blog/[slug]/page.tsx (100%) rename app/{ => (app)}/blog/page.tsx (100%) rename app/{ => (app)}/cgv/page.tsx (100%) rename app/{ => (app)}/confidentialite/page.tsx (100%) rename app/{ => (app)}/construction-maison-douai/page.tsx (100%) rename app/{ => (app)}/construction-maison-orchies/page.tsx (100%) rename app/{ => (app)}/construction-maison-valenciennes/page.tsx (100%) rename app/{ => (app)}/construction-maison/page.tsx (100%) rename app/{ => (app)}/contact/page.tsx (100%) rename app/{ => (app)}/creation-acces/page.tsx (100%) rename app/{ => (app)}/demolition/page.tsx (100%) rename app/{ => (app)}/globals.css (100%) rename app/{ => (app)}/layout.tsx (100%) rename app/{ => (app)}/macon-flines-lez-raches/page.tsx (100%) rename app/{ => (app)}/macon-mouchin/page.tsx (100%) rename app/{ => (app)}/macon-saint-amand-les-eaux/page.tsx (100%) rename app/{ => (app)}/mentions-legales/page.tsx (100%) rename app/{ => (app)}/page.tsx (100%) rename app/{ => (app)}/partenaires/page.tsx (100%) rename app/{ => (app)}/realisations/page.tsx (100%) rename app/{ => (app)}/renovation-maison-douai/page.tsx (100%) rename app/{ => (app)}/renovation-maison-orchies/page.tsx (100%) rename app/{ => (app)}/renovation/page.tsx (100%) rename app/{ => (app)}/services/page.tsx (100%) create mode 100644 app/(payload)/layout.tsx diff --git a/app/api/contact/route.ts b/app/(app)/api/contact/route.ts similarity index 100% rename from app/api/contact/route.ts rename to app/(app)/api/contact/route.ts diff --git a/app/api/devis/route.ts b/app/(app)/api/devis/route.ts similarity index 100% rename from app/api/devis/route.ts rename to app/(app)/api/devis/route.ts diff --git a/app/assainissement/page.tsx b/app/(app)/assainissement/page.tsx similarity index 100% rename from app/assainissement/page.tsx rename to app/(app)/assainissement/page.tsx diff --git a/app/blog/[slug]/page.tsx b/app/(app)/blog/[slug]/page.tsx similarity index 100% rename from app/blog/[slug]/page.tsx rename to app/(app)/blog/[slug]/page.tsx diff --git a/app/blog/page.tsx b/app/(app)/blog/page.tsx similarity index 100% rename from app/blog/page.tsx rename to app/(app)/blog/page.tsx diff --git a/app/cgv/page.tsx b/app/(app)/cgv/page.tsx similarity index 100% rename from app/cgv/page.tsx rename to app/(app)/cgv/page.tsx diff --git a/app/confidentialite/page.tsx b/app/(app)/confidentialite/page.tsx similarity index 100% rename from app/confidentialite/page.tsx rename to app/(app)/confidentialite/page.tsx diff --git a/app/construction-maison-douai/page.tsx b/app/(app)/construction-maison-douai/page.tsx similarity index 100% rename from app/construction-maison-douai/page.tsx rename to app/(app)/construction-maison-douai/page.tsx diff --git a/app/construction-maison-orchies/page.tsx b/app/(app)/construction-maison-orchies/page.tsx similarity index 100% rename from app/construction-maison-orchies/page.tsx rename to app/(app)/construction-maison-orchies/page.tsx diff --git a/app/construction-maison-valenciennes/page.tsx b/app/(app)/construction-maison-valenciennes/page.tsx similarity index 100% rename from app/construction-maison-valenciennes/page.tsx rename to app/(app)/construction-maison-valenciennes/page.tsx diff --git a/app/construction-maison/page.tsx b/app/(app)/construction-maison/page.tsx similarity index 100% rename from app/construction-maison/page.tsx rename to app/(app)/construction-maison/page.tsx diff --git a/app/contact/page.tsx b/app/(app)/contact/page.tsx similarity index 100% rename from app/contact/page.tsx rename to app/(app)/contact/page.tsx diff --git a/app/creation-acces/page.tsx b/app/(app)/creation-acces/page.tsx similarity index 100% rename from app/creation-acces/page.tsx rename to app/(app)/creation-acces/page.tsx diff --git a/app/demolition/page.tsx b/app/(app)/demolition/page.tsx similarity index 100% rename from app/demolition/page.tsx rename to app/(app)/demolition/page.tsx diff --git a/app/globals.css b/app/(app)/globals.css similarity index 100% rename from app/globals.css rename to app/(app)/globals.css diff --git a/app/layout.tsx b/app/(app)/layout.tsx similarity index 100% rename from app/layout.tsx rename to app/(app)/layout.tsx diff --git a/app/macon-flines-lez-raches/page.tsx b/app/(app)/macon-flines-lez-raches/page.tsx similarity index 100% rename from app/macon-flines-lez-raches/page.tsx rename to app/(app)/macon-flines-lez-raches/page.tsx diff --git a/app/macon-mouchin/page.tsx b/app/(app)/macon-mouchin/page.tsx similarity index 100% rename from app/macon-mouchin/page.tsx rename to app/(app)/macon-mouchin/page.tsx diff --git a/app/macon-saint-amand-les-eaux/page.tsx b/app/(app)/macon-saint-amand-les-eaux/page.tsx similarity index 100% rename from app/macon-saint-amand-les-eaux/page.tsx rename to app/(app)/macon-saint-amand-les-eaux/page.tsx diff --git a/app/mentions-legales/page.tsx b/app/(app)/mentions-legales/page.tsx similarity index 100% rename from app/mentions-legales/page.tsx rename to app/(app)/mentions-legales/page.tsx diff --git a/app/page.tsx b/app/(app)/page.tsx similarity index 100% rename from app/page.tsx rename to app/(app)/page.tsx diff --git a/app/partenaires/page.tsx b/app/(app)/partenaires/page.tsx similarity index 100% rename from app/partenaires/page.tsx rename to app/(app)/partenaires/page.tsx diff --git a/app/realisations/page.tsx b/app/(app)/realisations/page.tsx similarity index 100% rename from app/realisations/page.tsx rename to app/(app)/realisations/page.tsx diff --git a/app/renovation-maison-douai/page.tsx b/app/(app)/renovation-maison-douai/page.tsx similarity index 100% rename from app/renovation-maison-douai/page.tsx rename to app/(app)/renovation-maison-douai/page.tsx diff --git a/app/renovation-maison-orchies/page.tsx b/app/(app)/renovation-maison-orchies/page.tsx similarity index 100% rename from app/renovation-maison-orchies/page.tsx rename to app/(app)/renovation-maison-orchies/page.tsx diff --git a/app/renovation/page.tsx b/app/(app)/renovation/page.tsx similarity index 100% rename from app/renovation/page.tsx rename to app/(app)/renovation/page.tsx diff --git a/app/services/page.tsx b/app/(app)/services/page.tsx similarity index 100% rename from app/services/page.tsx rename to app/(app)/services/page.tsx diff --git a/app/(payload)/layout.tsx b/app/(payload)/layout.tsx new file mode 100644 index 0000000..4cf2f5d --- /dev/null +++ b/app/(payload)/layout.tsx @@ -0,0 +1,23 @@ +import { RootLayout, handleServerFunctions } from '@payloadcms/next/layouts'; +import type { ServerFunctionClient } from 'payload'; +import React from 'react'; +import config from '../../payload.config'; +import { importMap } from './gestion59/importMap'; + +export default function AdminLayout({ children }: { children: React.ReactNode }) { + const serverFunction: ServerFunctionClient = async (args) => { + 'use server'; + return handleServerFunctions({ + ...args, + config, + importMap, + }); + }; + + return RootLayout({ + config, + importMap, + serverFunction, + children, + }); +}