From 32361403d0bb0293081bec5ab4216c2eef62b421 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Mon, 13 Apr 2026 21:46:37 +0200 Subject: [PATCH] fix(brochure): use dynamic base URL and resolve singular/plural routing conflict --- app/actions/brochure.ts | 4 +++- next.config.mjs | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/actions/brochure.ts b/app/actions/brochure.ts index 86d62eab..cd75a6ad 100644 --- a/app/actions/brochure.ts +++ b/app/actions/brochure.ts @@ -1,6 +1,7 @@ 'use server'; import { getServerAppServices } from '@/lib/services/create-services.server'; +import { config } from '@/lib/config'; export async function requestBrochureAction(formData: FormData) { const services = getServerAppServices(); @@ -76,7 +77,8 @@ export async function requestBrochureAction(formData: FormData) { } // 3. Send Brochure via Email - const brochureUrl = `https://klz-cables.com/brochure/klz-product-catalog-${locale}.pdf`; + const baseUrl = config.baseUrl || 'https://klz-cables.com'; + const brochureUrl = `${baseUrl}/brochure/klz-product-catalog-${locale}.pdf`; try { const { sendEmail } = await import('@/lib/mail/mailer'); diff --git a/next.config.mjs b/next.config.mjs index 9d516ede..5f848d5e 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -435,16 +435,16 @@ const nextConfig = { destination: '/api/datasheets/:path*', }, { - source: '/:locale/brochures/:path*', - destination: '/api/brochures/:path*', + source: '/:locale/brochure/:path*', + destination: '/brochure/:path*', }, { source: '/datasheets/:path*', destination: '/api/datasheets/:path*', }, { - source: '/brochures/:path*', - destination: '/api/brochures/:path*', + source: '/brochure/:path*', + destination: '/brochure/:path*', }, { source: '/de/produkte',