From 0f47193be7290ef40fabc8a306a7a4e12877c9c6 Mon Sep 17 00:00:00 2001 From: paula_rodriguezslash <paula.rodriguez@slashmobility.com> Date: Wed, 24 Apr 2024 13:09:14 +0100 Subject: [PATCH] errors in the alerts --- client/src/components/BookingList/BookingCard/BookingCard.tsx | 2 +- client/src/components/PaymentForm/PaymentForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/BookingList/BookingCard/BookingCard.tsx b/client/src/components/BookingList/BookingCard/BookingCard.tsx index 60d2ffc..774dc95 100644 --- a/client/src/components/BookingList/BookingCard/BookingCard.tsx +++ b/client/src/components/BookingList/BookingCard/BookingCard.tsx @@ -28,7 +28,7 @@ function BookingCard({ flight }: IBookingCard) { navigate('/booking/payment-form', { state: { bookingInfo } }); } catch (error) { console.error("Booking failed:", error); - alert("Failed to book flight. Please try again."); + alert("Failed to book flight. Please try again. Error: ${error.message}"); } }; diff --git a/client/src/components/PaymentForm/PaymentForm.tsx b/client/src/components/PaymentForm/PaymentForm.tsx index 9afb97a..64ac254 100644 --- a/client/src/components/PaymentForm/PaymentForm.tsx +++ b/client/src/components/PaymentForm/PaymentForm.tsx @@ -77,7 +77,7 @@ const PaymentForm = () => { } } catch (error) { console.error('Payment confirmation failed:', error); - setMessage("An error occurred while confirming the payment."); + setMessage("An error occurred while confirming the payment. Error: ${error.message}"); } finally { setLoading(false); } -- GitLab