diff --git a/src/components/client/auth/register/RegisterForm.tsx b/src/components/client/auth/register/RegisterForm.tsx index 02f54e986..f8bc03414 100644 --- a/src/components/client/auth/register/RegisterForm.tsx +++ b/src/components/client/auth/register/RegisterForm.tsx @@ -19,6 +19,7 @@ import EmailField from 'components/common/form/EmailField' import AcceptNewsLetterField from 'components/common/form/AcceptNewsletterField' export type RegisterFormData = { + type: ProfileType firstName: string lastName: string email: string @@ -29,10 +30,16 @@ export type RegisterFormData = { newsletter?: boolean } +enum ProfileType { + INDIVIDUAL = 'individual', + CORPORATE = 'corporate', +} + const validationSchema: yup.SchemaOf = yup .object() .defined() .shape({ + type: yup.mixed().required().oneOf(Object.values(ProfileType)), firstName: name.required(), lastName: name.required(), email: email.required(), @@ -44,6 +51,7 @@ const validationSchema: yup.SchemaOf = yup }) const defaults: RegisterFormData = { + type: ProfileType.INDIVIDUAL, firstName: '', lastName: '', email: '', diff --git a/src/service/apiEndpoints.ts b/src/service/apiEndpoints.ts index 8d5512c2d..1c907ba48 100644 --- a/src/service/apiEndpoints.ts +++ b/src/service/apiEndpoints.ts @@ -10,7 +10,7 @@ type Endpoint = { export const endpoints = { auth: { login: { url: '/login', method: 'POST' }, - register: { url: '/register/individual', method: 'POST' }, + register: { url: '/register', method: 'POST' }, refresh: { url: '/refresh', method: 'POST' }, providerLogin: { url: '/provider-login', method: 'POST' }, },