fix auth errors and add tracker-registration
This commit is contained in:
@ -87,22 +87,23 @@ export const useFormValidation = (
|
||||
e.preventDefault();
|
||||
// Проверка валидации формы
|
||||
if (validateForm()) {
|
||||
setLoader(true)
|
||||
setLoader(true);
|
||||
let newformData = { ...formData, is_partner: isPartner ? 1 : 0 };
|
||||
delete newformData.secondPassword;
|
||||
|
||||
|
||||
try {
|
||||
apiRequest(apiEndpoint, {
|
||||
method: "POST",
|
||||
data: newformData
|
||||
}).then((data) => {
|
||||
setLoader(false)
|
||||
setLoader(false);
|
||||
if ("errors" in data) {
|
||||
return showNotificationError('Аккаунт с таким логином или email уже существуе');
|
||||
return showNotificationError(
|
||||
"Аккаунт с таким логином или email уже существуе"
|
||||
);
|
||||
}
|
||||
if (!data.id) {
|
||||
return showNotificationError('Ошибка');
|
||||
return showNotificationError("Ошибка");
|
||||
}
|
||||
handleClearForm();
|
||||
showNotificationTrue();
|
||||
|
Reference in New Issue
Block a user