diff --git a/src/components/Office/ShipmentForm/ShipmentForm.jsx b/src/components/Office/ShipmentForm/ShipmentForm.jsx index 62f886d3703..fe86089d481 100644 --- a/src/components/Office/ShipmentForm/ShipmentForm.jsx +++ b/src/components/Office/ShipmentForm/ShipmentForm.jsx @@ -93,6 +93,7 @@ const ShipmentForm = (props) => { const { moveCode } = useParams(); const navigate = useNavigate(); + const [datesErrorMessage, setDatesErrorMessage] = useState(null); const [errorMessage, setErrorMessage] = useState(null); const [successMessage, setSuccessMessage] = useState(null); const [shipmentAddressUpdateReviewErrorMessage, setShipmentAddressUpdateReviewErrorMessage] = useState(null); @@ -202,7 +203,7 @@ const ShipmentForm = (props) => { useEffect(() => { const onErrorHandler = (e) => { const { response } = e; - setErrorMessage(response?.body?.detail); + setDatesErrorMessage(response?.body?.detail); }; dateSelectionWeekendHolidayCheck( dateSelectionIsWeekendHoliday, @@ -219,7 +220,7 @@ const ShipmentForm = (props) => { useEffect(() => { const onErrorHandler = (e) => { const { response } = e; - setErrorMessage(response?.body?.detail); + setDatesErrorMessage(response?.body?.detail); }; dateSelectionWeekendHolidayCheck( dateSelectionIsWeekendHoliday, @@ -628,7 +629,7 @@ const ShipmentForm = (props) => { }); const onErrorHandler = (errResponse) => { const { response } = errResponse; - setErrorMessage(response?.body?.detail); + setDatesErrorMessage(response?.body?.detail); }; dateSelectionWeekendHolidayCheck( dateSelectionIsWeekendHoliday, @@ -699,9 +700,15 @@ const ShipmentForm = (props) => { errorMessage={shipmentAddressUpdateReviewErrorMessage} setErrorMessage={setShipmentAddressUpdateReviewErrorMessage} /> + + {datesErrorMessage && ( + + {datesErrorMessage} + + )} {errorMessage && ( - + {errorMessage} )}