| <Route exact path={BASE_PAGE} component={HomePage} /> | <Route exact path={BASE_PAGE} component={HomePage} /> | ||||
| <AuthRoute exact path={LOGIN_PAGE} component={LoginPage} /> | <AuthRoute exact path={LOGIN_PAGE} component={LoginPage} /> | ||||
| <AuthRoute exact path={ADMIN_LOGIN_PAGE} component={AdminLoginPage} /> | <AuthRoute exact path={ADMIN_LOGIN_PAGE} component={AdminLoginPage} /> | ||||
| <AuthRoute path={REGISTER_PAGE} component={Register} /> | |||||
| <AuthRoute exact path={REGISTER_PAGE} component={Register} /> | |||||
| <AuthRoute path={FORGOT_PASSWORD_MAIL_SENT} component={MailSent} /> | <AuthRoute path={FORGOT_PASSWORD_MAIL_SENT} component={MailSent} /> | ||||
| <AuthRoute path={FORGOT_PASSWORD_PAGE} component={ForgotPasswordPage} /> | <AuthRoute path={FORGOT_PASSWORD_PAGE} component={ForgotPasswordPage} /> | ||||
| <AuthRoute path={RESET_PASSWORD_PAGE} component={ResetPasswordPage} /> | <AuthRoute path={RESET_PASSWORD_PAGE} component={ResetPasswordPage} /> |
| if (currentStep !== 3) { | if (currentStep !== 3) { | ||||
| setCurrentStep((prevState) => prevState + 1); | setCurrentStep((prevState) => prevState + 1); | ||||
| } else { | } else { | ||||
| if (!informations.image) { | |||||
| setImageError(true); | |||||
| } else { | |||||
| // if (!informations.image) { | |||||
| // setImageError(true); | |||||
| // } else { | |||||
| registerUser({ ...informations, ...values }); | registerUser({ ...informations, ...values }); | ||||
| } | |||||
| // } | |||||
| } | } | ||||
| setInformations({ ...informations, ...values }); | setInformations({ ...informations, ...values }); | ||||
| }; | }; |
| const requestBody = new FormData(); | const requestBody = new FormData(); | ||||
| requestBody.append("email", payload.values.mail); | requestBody.append("email", payload.values.mail); | ||||
| requestBody.append("password", payload.values.registerPassword); | requestBody.append("password", payload.values.registerPassword); | ||||
| requestBody.append("file", payload.values.image); | |||||
| if (payload.values.image) { | |||||
| requestBody.append("file", payload.values.image); | |||||
| } | |||||
| requestBody.append("company[name]", payload.values.nameOfFirm); | requestBody.append("company[name]", payload.values.nameOfFirm); | ||||
| requestBody.append("company[PIB]", payload.values.PIB); | requestBody.append("company[PIB]", payload.values.PIB); | ||||
| if (payload.values.phoneNumber.toString().length !== 0) | if (payload.values.phoneNumber.toString().length !== 0) |