mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
Merge branch 'master' of https://github.com/abouolia/Ratteb
This commit is contained in:
@@ -55,7 +55,13 @@ function InviteUserForm({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Handle the response error.
|
// Handle the response error.
|
||||||
const onError = (errors) => {
|
const onError = (error) => {
|
||||||
|
const {
|
||||||
|
response: {
|
||||||
|
data: { errors },
|
||||||
|
},
|
||||||
|
} = error;
|
||||||
|
|
||||||
const errorsTransformed = transformApiErrors(errors);
|
const errorsTransformed = transformApiErrors(errors);
|
||||||
|
|
||||||
setErrors({ ...errorsTransformed });
|
setErrors({ ...errorsTransformed });
|
||||||
|
|||||||
@@ -6,5 +6,8 @@ export const transformApiErrors = (errors) => {
|
|||||||
if (errors.find((error) => error.type === 'EMAIL.ALREADY.INVITED')) {
|
if (errors.find((error) => error.type === 'EMAIL.ALREADY.INVITED')) {
|
||||||
fields.email = formatMessage({ id: 'email_is_already_used' });
|
fields.email = formatMessage({ id: 'email_is_already_used' });
|
||||||
}
|
}
|
||||||
|
if (errors.find((error) => error.type === 'EMAIL.ALREADY.EXISTS')) {
|
||||||
|
fields.email = formatMessage({ id: 'email_is_already_used' });
|
||||||
|
}
|
||||||
return fields;
|
return fields;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ export default function ReceiptFormFloatingActions() {
|
|||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
|
loading={isSubmitting}
|
||||||
intent={Intent.PRIMARY}
|
intent={Intent.PRIMARY}
|
||||||
onClick={handleSubmitCloseBtnClick}
|
onClick={handleSubmitCloseBtnClick}
|
||||||
text={<T id={'save_close'} />}
|
text={<T id={'save_close'} />}
|
||||||
|
|||||||
Reference in New Issue
Block a user