mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
refactor(nestjs): hook up auth endpoints
This commit is contained in:
@@ -29,22 +29,19 @@ export default function Login() {
|
||||
|
||||
const handleSubmit = (values, { setSubmitting }) => {
|
||||
loginMutate({
|
||||
crediential: values.crediential,
|
||||
email: values.crediential,
|
||||
password: values.password,
|
||||
}).catch(
|
||||
({
|
||||
response: {
|
||||
data: { errors },
|
||||
},
|
||||
}) => {
|
||||
const toastBuilders = transformLoginErrorsToToasts(errors);
|
||||
}).catch(({ response }) => {
|
||||
const {
|
||||
data: { errors },
|
||||
} = response;
|
||||
const toastBuilders = transformLoginErrorsToToasts(errors);
|
||||
|
||||
toastBuilders.forEach((builder) => {
|
||||
Toaster.show(builder);
|
||||
});
|
||||
setSubmitting(false);
|
||||
},
|
||||
);
|
||||
toastBuilders.forEach((builder) => {
|
||||
Toaster.show(builder);
|
||||
});
|
||||
setSubmitting(false);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -70,7 +67,10 @@ function LoginFooterLinks() {
|
||||
<AuthFooterLinks>
|
||||
{!signupDisabled && (
|
||||
<AuthFooterLink>
|
||||
<T id={'dont_have_an_account'} /> <Link to={'/auth/register'}><T id={'sign_up'} /></Link>
|
||||
<T id={'dont_have_an_account'} />{' '}
|
||||
<Link to={'/auth/register'}>
|
||||
<T id={'sign_up'} />
|
||||
</Link>
|
||||
</AuthFooterLink>
|
||||
)}
|
||||
<AuthFooterLink>
|
||||
|
||||
@@ -53,22 +53,20 @@ export default function RegisterUserForm() {
|
||||
},
|
||||
);
|
||||
})
|
||||
.catch(
|
||||
({
|
||||
response: {
|
||||
data: { errors },
|
||||
},
|
||||
}) => {
|
||||
const formErrors = transformRegisterErrorsToForm(errors);
|
||||
const toastMessages = transformRegisterToastMessages(errors);
|
||||
.catch(({ response }) => {
|
||||
const {
|
||||
data: { errors },
|
||||
} = response;
|
||||
|
||||
const formErrors = transformRegisterErrorsToForm(errors);
|
||||
const toastMessages = transformRegisterToastMessages(errors);
|
||||
|
||||
toastMessages.forEach((toastMessage) => {
|
||||
AppToaster.show(toastMessage);
|
||||
});
|
||||
setErrors(formErrors);
|
||||
setSubmitting(false);
|
||||
},
|
||||
);
|
||||
toastMessages.forEach((toastMessage) => {
|
||||
AppToaster.show(toastMessage);
|
||||
});
|
||||
setErrors(formErrors);
|
||||
setSubmitting(false);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user