diff --git a/apps/edr-freight-web/backoffice/src/constants/apiConfig.ts b/apps/edr-freight-web/backoffice/src/constants/apiConfig.ts index 030b051a1..a7c8670cf 100644 --- a/apps/edr-freight-web/backoffice/src/constants/apiConfig.ts +++ b/apps/edr-freight-web/backoffice/src/constants/apiConfig.ts @@ -1,3 +1,3 @@ -export const API_BASE_URL = 'https://edrfreightapi.triaplc.com'; +// export const API_BASE_URL = 'https://edrfreightapi.triaplc.com'; -// export const API_BASE_URL = 'http://localhost:3001'; +export const API_BASE_URL = 'http://localhost:3001'; diff --git a/apps/edr-freight-web/portal/src/constants/apiConfig.ts b/apps/edr-freight-web/portal/src/constants/apiConfig.ts index dce8aad63..fc9f57a58 100644 --- a/apps/edr-freight-web/portal/src/constants/apiConfig.ts +++ b/apps/edr-freight-web/portal/src/constants/apiConfig.ts @@ -1,3 +1,3 @@ -export const API_BASE_URL = 'https://edrfreightapi.triaplc.com'; -// export const API_BASE_URL = 'http://localhost:3001'; +// export const API_BASE_URL = 'https://edrfreightapi.triaplc.com'; +export const API_BASE_URL = 'http://localhost:3001'; diff --git a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step1-contract-type.tsx b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step1-contract-type.tsx index b4fa15f6b..1df664ff8 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step1-contract-type.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step1-contract-type.tsx @@ -128,7 +128,7 @@ export function Step1ContractType({ (sl) => sl.id === booking.shippingLineId, ); if (shippingLine) { - form.setValue("shippingLine", shippingLine.name); + form.setValue("shippingLine", shippingLine.id); } } diff --git a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step4-route.tsx b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step4-route.tsx index cd05f4e9a..40fc1f061 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step4-route.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step4-route.tsx @@ -35,7 +35,7 @@ export function Step4Route({ const shippingLineOptions = useMemo(() => { if (!referenceData?.shipping_line) return []; - // The form keys shipping line by name, so options are keyed by name too. + // The form keys shipping line by ID (required by API as UUID). // Dedupe by name: if the reference data has two lines sharing a name, a // duplicate option would crash Mantine's Select ("Duplicate options..."). const seen = new Set(); @@ -43,7 +43,7 @@ export function Step4Route({ for (const sl of referenceData.shipping_line) { if (!sl.name || seen.has(sl.name)) continue; seen.add(sl.name); - options.push({ value: sl.name, label: sl.name }); + options.push({ value: sl.id, label: sl.name }); } return options; }, [referenceData]); diff --git a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx index c9c8265fe..ef5c840ef 100644 --- a/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx +++ b/apps/edr-freight-web/portal/src/pages/bookings/new-booking-form/step8-review.tsx @@ -151,6 +151,9 @@ export function Step8Review({ const serviceType = referenceData?.service.find( (s) => s.id === values.serviceTypeId, ); + const shippingLine = referenceData?.shipping_line.find( + (sl) => sl.id === values.shippingLine, + ); const containerSummary = values.cargoType === "container" && values.containers.length > 0 @@ -274,7 +277,7 @@ export function Step8Review({ value={`${originYardName} → ${destinationYardName}`} /> - +