mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40: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.
|
||||
const onError = (errors) => {
|
||||
const onError = (error) => {
|
||||
const {
|
||||
response: {
|
||||
data: { errors },
|
||||
},
|
||||
} = error;
|
||||
|
||||
const errorsTransformed = transformApiErrors(errors);
|
||||
|
||||
setErrors({ ...errorsTransformed });
|
||||
|
||||
@@ -6,5 +6,8 @@ export const transformApiErrors = (errors) => {
|
||||
if (errors.find((error) => error.type === 'EMAIL.ALREADY.INVITED')) {
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -81,6 +81,7 @@ export default function ReceiptFormFloatingActions() {
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
disabled={isSubmitting}
|
||||
loading={isSubmitting}
|
||||
intent={Intent.PRIMARY}
|
||||
onClick={handleSubmitCloseBtnClick}
|
||||
text={<T id={'save_close'} />}
|
||||
|
||||
Reference in New Issue
Block a user