From 618b3064c3e97735d6bcfcfe73dd426e66de1c87 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 23 Dec 2025 13:04:29 +0100 Subject: [PATCH] fix: use environment variable for API URL in carrier accept/reject pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded localhost:4000 URLs with NEXT_PUBLIC_API_URL environment variable in carrier portal pages to support different environments (dev/staging/production). Pages updated: - app/carrier/accept/[token]/page.tsx - app/carrier/reject/[token]/page.tsx This fixes the issue where preprod environment (app.preprod.xpeditis.com) was calling localhost:4000 instead of the correct API endpoint (api.preprod.xpeditis.com). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- apps/frontend/app/carrier/accept/[token]/page.tsx | 3 ++- apps/frontend/app/carrier/reject/[token]/page.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/frontend/app/carrier/accept/[token]/page.tsx b/apps/frontend/app/carrier/accept/[token]/page.tsx index e50e7e1..45de17e 100644 --- a/apps/frontend/app/carrier/accept/[token]/page.tsx +++ b/apps/frontend/app/carrier/accept/[token]/page.tsx @@ -32,7 +32,8 @@ export default function CarrierAcceptPage() { try { // Appeler l'API backend pour accepter le booking - const response = await fetch(`http://localhost:4000/api/v1/csv-booking-actions/accept/${token}`, { + const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; + const response = await fetch(`${apiUrl}/api/v1/csv-booking-actions/accept/${token}`, { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/apps/frontend/app/carrier/reject/[token]/page.tsx b/apps/frontend/app/carrier/reject/[token]/page.tsx index 1d52686..17df849 100644 --- a/apps/frontend/app/carrier/reject/[token]/page.tsx +++ b/apps/frontend/app/carrier/reject/[token]/page.tsx @@ -32,7 +32,8 @@ export default function CarrierRejectPage() { try { // Appeler l'API backend pour refuser le booking - const response = await fetch(`http://localhost:4000/api/v1/csv-booking-actions/reject/${token}`, { + const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; + const response = await fetch(`${apiUrl}/api/v1/csv-booking-actions/reject/${token}`, { method: 'GET', headers: { 'Content-Type': 'application/json',