fix: use environment variable for API URL in carrier accept/reject pages
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 <noreply@anthropic.com>
This commit is contained in:
parent
6603c458d4
commit
618b3064c3
@ -32,7 +32,8 @@ export default function CarrierAcceptPage() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Appeler l'API backend pour accepter le booking
|
// 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',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@ -32,7 +32,8 @@ export default function CarrierRejectPage() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Appeler l'API backend pour refuser le booking
|
// 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',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user