fix(brochure): use dynamic base URL and resolve singular/plural routing conflict
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 11s
Build & Deploy / 🧪 QA (push) Successful in 1m11s
Build & Deploy / 🏗️ Build (push) Successful in 2m30s
Build & Deploy / 🚀 Deploy (push) Successful in 21s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 4m59s
Build & Deploy / 🔔 Notify (push) Successful in 2s
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 11s
Build & Deploy / 🧪 QA (push) Successful in 1m11s
Build & Deploy / 🏗️ Build (push) Successful in 2m30s
Build & Deploy / 🚀 Deploy (push) Successful in 21s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 4m59s
Build & Deploy / 🔔 Notify (push) Successful in 2s
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { getServerAppServices } from '@/lib/services/create-services.server';
|
import { getServerAppServices } from '@/lib/services/create-services.server';
|
||||||
|
import { config } from '@/lib/config';
|
||||||
|
|
||||||
export async function requestBrochureAction(formData: FormData) {
|
export async function requestBrochureAction(formData: FormData) {
|
||||||
const services = getServerAppServices();
|
const services = getServerAppServices();
|
||||||
@@ -76,7 +77,8 @@ export async function requestBrochureAction(formData: FormData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. Send Brochure via Email
|
// 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 {
|
try {
|
||||||
const { sendEmail } = await import('@/lib/mail/mailer');
|
const { sendEmail } = await import('@/lib/mail/mailer');
|
||||||
|
|||||||
@@ -435,16 +435,16 @@ const nextConfig = {
|
|||||||
destination: '/api/datasheets/:path*',
|
destination: '/api/datasheets/:path*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/:locale/brochures/:path*',
|
source: '/:locale/brochure/:path*',
|
||||||
destination: '/api/brochures/:path*',
|
destination: '/brochure/:path*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/datasheets/:path*',
|
source: '/datasheets/:path*',
|
||||||
destination: '/api/datasheets/:path*',
|
destination: '/api/datasheets/:path*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/brochures/:path*',
|
source: '/brochure/:path*',
|
||||||
destination: '/api/brochures/:path*',
|
destination: '/brochure/:path*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: '/de/produkte',
|
source: '/de/produkte',
|
||||||
|
|||||||
Reference in New Issue
Block a user