feat(#169): added missin region input field (#17)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 6 years ago committed by GitHub
parent c205528de6
commit 5f152d7b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/features/Register/components/RegistrationStep/config.tsx
  2. 2
      src/features/Register/components/RegistrationStep/hooks/useForm.tsx
  3. 6
      src/features/Register/components/RegistrationStep/index.tsx
  4. 3
      src/requests/register.tsx

@ -9,4 +9,5 @@ export const formIds = {
password: 'password',
phone: 'phone',
postalCode: 'postalCode',
region: 'region',
}

@ -69,6 +69,7 @@ export const useForm = () => {
const email = readFieldValue(formIds.email)
const password = readFieldValue(formIds.password)
const postalCode = Number(readFieldValue(formIds.postalCode))
const region = readFieldValue(formIds.region)
const address1 = readFieldValue(formIds.address1)
const address2 = readFieldValue(formIds.address2)
@ -84,6 +85,7 @@ export const useForm = () => {
password,
phone,
postalCode,
region,
}).then(goToLoginPage, showError)
}
}

@ -99,6 +99,12 @@ export const RegistrationStep = () => {
label='Почтовый адрес'
pattern={postalCodeRegex}
/>
<Input
required
id={formIds.region}
label='Регион'
pattern={commonFieldRegex}
/>
<Input
required
id={formIds.address1}

@ -25,6 +25,7 @@ type Args = {
password: string,
phone: string,
postalCode: number,
region: string,
}
export const register = async ({
@ -39,6 +40,7 @@ export const register = async ({
password,
phone,
postalCode,
region,
}: Args) => {
const config = {
body: {
@ -54,6 +56,7 @@ export const register = async ({
_p_password: password,
_p_phone: phone,
_p_postal_code: postalCode,
_p_region: region,
},
proc,
},

Loading…
Cancel
Save