Skip to content

Commit 143ac96

Browse files
authored
Merge pull request #1412 from w3bdesign/develop
Cleanup
2 parents 6e3d984 + 59a3de9 commit 143ac96

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/User/UserRegistration.component.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState } from 'react';
2-
import { useMutation, ApolloError } from '@apollo/client';
2+
import { useMutation } from '@apollo/client';
33
import { useForm, FormProvider } from 'react-hook-form';
44
import { CREATE_USER } from '../../utils/gql/GQL_MUTATIONS';
55
import { InputField } from '../Input/InputField.component';
@@ -14,6 +14,11 @@ interface IRegistrationData {
1414
lastName: string;
1515
}
1616

17+
/**
18+
* User registration component that handles WooCommerce customer creation
19+
* @function UserRegistration
20+
* @returns {JSX.Element} - Rendered component with registration form
21+
*/
1722
const UserRegistration = () => {
1823
const methods = useForm<IRegistrationData>();
1924
const [registerUser, { loading, error }] = useMutation(CREATE_USER);
@@ -27,14 +32,12 @@ const UserRegistration = () => {
2732

2833
const customer = response.data?.registerCustomer?.customer;
2934
if (customer) {
30-
console.log('Customer registration successful:', customer);
3135
setRegistrationCompleted(true);
3236
} else {
3337
throw new Error('Failed to register customer');
3438
}
3539
} catch (err: unknown) {
36-
const error = err as ApolloError;
37-
console.error('Registration error:', error);
40+
console.error('Registration error');
3841
}
3942
};
4043

0 commit comments

Comments
 (0)