3434</template >
3535
3636<script setup>
37- import { Form , Field , ErrorMessage } from ' vee-validate'
38- import { uid } from ' uid'
37+ import { Form , Field , ErrorMessage } from " vee-validate" ;
38+ import { uid } from " uid" ;
3939
40- import { BILLING_FIELDS , BILLING_SCHEMA } from ' ./constants/BILLING_FIELDS'
40+ import { BILLING_FIELDS , BILLING_SCHEMA } from " ./constants/BILLING_FIELDS" ;
4141
42- import CHECKOUT_MUTATION from ' @/apollo/mutations/CHECKOUT_MUTATION.gql'
42+ import CHECKOUT_MUTATION from " @/apollo/mutations/CHECKOUT_MUTATION.gql" ;
4343
4444const upperCaseFirstChar = (input ) =>
45- input .charAt (0 ).toUpperCase () + input .slice (1 )
45+ input .charAt (0 ).toUpperCase () + input .slice (1 );
4646
47- const paymentMethod = ' cod'
47+ const paymentMethod = " cod" ;
4848
4949const handleSubmit = ({
5050 firstName,
@@ -71,7 +71,7 @@ const handleSubmit = ({
7171 email,
7272 phone,
7373 company,
74- }
74+ };
7575
7676 const checkoutData = {
7777 clientMutationId: uid (),
@@ -80,19 +80,19 @@ const handleSubmit = ({
8080 shipToDifferentAddress: false ,
8181 paymentMethod,
8282 isPaid: false ,
83- transactionId: ' hjkhjkhsdsdiui' ,
84- }
83+ transactionId: " hjkhjkhsdsdiui" ,
84+ };
8585
86- const variables = { input: checkoutData }
86+ const variables = { input: checkoutData };
8787
8888 const { mutate , onDone , onError } = useMutation (CHECKOUT_MUTATION , {
8989 variables,
90- })
90+ });
9191
92- mutate (checkoutData)
92+ mutate (checkoutData);
9393
94- onDone (() => alert (' Order placed!' ))
94+ onDone (() => alert (" Order placed!" ));
9595
96- onError (() => alert (' Error, order not placed' ))
97- }
96+ onError (() => alert (" Error, order not placed" ));
97+ };
9898 </script >
0 commit comments