fix auth errors and add tracker-registration

This commit is contained in:
Mikola
2024-03-11 18:24:03 +03:00
parent 012ef7d4b6
commit 2ed0be6664
6 changed files with 64 additions and 42 deletions

View File

@ -32,10 +32,10 @@ export const ModalRegistration = ({ active, setActive }) => {
const apiEndpoint = "/register/sign-up";
const { showNotification } = useNotification();
const showNotificationError = () => {
const showNotificationError = (error) => {
showNotification({
show: true,
text: "Аккаунт с таким логином или email уже существует",
text: error,
type: "error"
});
};
@ -58,7 +58,9 @@ export const ModalRegistration = ({ active, setActive }) => {
fields,
showNotificationError,
showNotificationTrue,
isPartner
isPartner,
setLoader,
closeModal
);
return (
@ -142,12 +144,7 @@ export const ModalRegistration = ({ active, setActive }) => {
<BaseButton
onClick={async (e) => {
e.preventDefault();
setLoader(true);
const result = await handleSubmit(e);
if (result === true) {
closeModal();
}
setLoader(false);
await handleSubmit(e);
}}
styles="button-box__submit"
>