From 368f256a70da1906d7527ac18d25a582a61edfed Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Sun, 14 Feb 2021 23:38:01 +0100 Subject: [PATCH 1/2] Remove more unused code --- components/Checkout/CheckoutForm.component.jsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/Checkout/CheckoutForm.component.jsx b/components/Checkout/CheckoutForm.component.jsx index e2d0713b8..79c139334 100644 --- a/components/Checkout/CheckoutForm.component.jsx +++ b/components/Checkout/CheckoutForm.component.jsx @@ -34,9 +34,7 @@ const CheckoutForm = () => { refetch(); }, onError: (error) => { - if (error) { - setRequestError(error); - } + setRequestError(error); }, } ); From 2bf6d3df43717caccee94b0e8a603da4769548f1 Mon Sep 17 00:00:00 2001 From: w3bdesign <45217974+w3bdesign@users.noreply.github.com> Date: Sun, 14 Feb 2021 23:40:40 +0100 Subject: [PATCH 2/2] Fix more errors --- components/Checkout/CheckoutForm.component.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/Checkout/CheckoutForm.component.jsx b/components/Checkout/CheckoutForm.component.jsx index 79c139334..487144ccf 100644 --- a/components/Checkout/CheckoutForm.component.jsx +++ b/components/Checkout/CheckoutForm.component.jsx @@ -40,7 +40,7 @@ const CheckoutForm = () => { ); // Get Cart Data. - const { loading, error, data, refetch } = useQuery(GET_CART, { + const { data, refetch } = useQuery(GET_CART, { notifyOnNetworkStatusChange: true, onCompleted: () => { // Update cart in the localStorage. @@ -58,8 +58,8 @@ const CheckoutForm = () => { } }, [orderData]); - const onSubmit = (data) => { - const checkOutData = createCheckoutData(data); + const onSubmit = (submitData) => { + const checkOutData = createCheckoutData(submitData); setOrderData(checkOutData); setRequestError(null); };