From f188724314663e0ce012f8bcdaf6caf588981d90 Mon Sep 17 00:00:00 2001 From: Mirlan Date: Tue, 27 Oct 2020 13:47:58 +0600 Subject: [PATCH] refactor(#509): removed first and last names in registration (#194) --- .../RegistrationStep/hooks/useSubmitHandler.tsx | 4 ---- .../RegistrationStep/hooks/useValidateForm.tsx | 10 ---------- .../components/RegistrationStep/index.tsx | 16 +--------------- src/requests/register.tsx | 6 ------ 4 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/features/Register/components/RegistrationStep/hooks/useSubmitHandler.tsx b/src/features/Register/components/RegistrationStep/hooks/useSubmitHandler.tsx index f57d7042..1928bbb0 100644 --- a/src/features/Register/components/RegistrationStep/hooks/useSubmitHandler.tsx +++ b/src/features/Register/components/RegistrationStep/hooks/useSubmitHandler.tsx @@ -20,15 +20,11 @@ export const useSubmitHandler = () => { event.preventDefault() if (validateForm()) { - const firstname = readTrimmedValue(formIds.firstname) - const lastname = readTrimmedValue(formIds.lastname) const email = readTrimmedValue(formIds.email) const password = readTrimmedValue(formIds.password) register({ email, - firstname, - lastname, password, }) } diff --git a/src/features/Register/components/RegistrationStep/hooks/useValidateForm.tsx b/src/features/Register/components/RegistrationStep/hooks/useValidateForm.tsx index e0e577fb..cd2bc09e 100644 --- a/src/features/Register/components/RegistrationStep/hooks/useValidateForm.tsx +++ b/src/features/Register/components/RegistrationStep/hooks/useValidateForm.tsx @@ -17,18 +17,8 @@ export const useValidateForm = () => { const validateForm = () => { let hasError = false - const firstname = readTrimmedValue(formIds.firstname) - const lastname = readTrimmedValue(formIds.lastname) const email = readTrimmedValue(formIds.email) const password = readTrimmedValue(formIds.password) - if (!firstname) { - updateFormError(formIds.firstname, 'error_fill_out_this_field') - hasError = true - } - if (!lastname) { - updateFormError(formIds.lastname, 'error_fill_out_this_field') - hasError = true - } if (!email) { updateFormError(formIds.email, 'error_empty_email') hasError = true diff --git a/src/features/Register/components/RegistrationStep/index.tsx b/src/features/Register/components/RegistrationStep/index.tsx index 8a3544ef..fba6d399 100644 --- a/src/features/Register/components/RegistrationStep/index.tsx +++ b/src/features/Register/components/RegistrationStep/index.tsx @@ -14,7 +14,7 @@ import { FormStore } from 'features/FormStore' import { useRegistrationForm } from './hooks' -const labelWidth = 116 +const labelWidth = 76 const Registration = () => { const { @@ -30,20 +30,6 @@ const Registration = () => { - - { const config = { body: { params: { _p_email: email, - _p_firstname: firstname, - _p_lastname: lastname, _p_password: password, }, proc,