Skip to content

Commit 2916aaf

Browse files
committed
Remove unused code
1 parent adc18b9 commit 2916aaf

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

components/Checkout/CheckoutForm.component.jsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import LoadingSpinner from '../LoadingSpinner/LoadingSpinner.component';
99

1010
import { GET_CART } from 'utils/gql/GQL_QUERIES';
1111
import { CHECKOUT_MUTATION } from 'utils/gql/GQL_MUTATIONS';
12-
1312
import { AppContext } from 'utils/context/AppContext';
1413

1514
import {
@@ -24,23 +23,23 @@ const CheckoutForm = () => {
2423
const [orderCompleted, setorderCompleted] = useState(false);
2524

2625
// Checkout GraphQL mutation
27-
const [
28-
checkout,
29-
{ data: checkoutResponse, loading: checkoutLoading, error: checkoutError },
30-
] = useMutation(CHECKOUT_MUTATION, {
31-
variables: {
32-
input: orderData,
33-
},
34-
onCompleted: () => {
35-
setorderCompleted(true);
36-
refetch();
37-
},
38-
onError: (error) => {
39-
if (error) {
40-
setRequestError(error);
41-
}
42-
},
43-
});
26+
const [checkout, { loading: checkoutLoading }] = useMutation(
27+
CHECKOUT_MUTATION,
28+
{
29+
variables: {
30+
input: orderData,
31+
},
32+
onCompleted: () => {
33+
setorderCompleted(true);
34+
refetch();
35+
},
36+
onError: (error) => {
37+
if (error) {
38+
setRequestError(error);
39+
}
40+
},
41+
}
42+
);
4443

4544
// Get Cart Data.
4645
const { loading, error, data, refetch } = useQuery(GET_CART, {

0 commit comments

Comments
 (0)