Merge pull request #2122 from automatisch/AUT-1239
feat: add error snackbar for updating role mappings
This commit is contained in:
@@ -56,6 +56,19 @@ function RoleMappings({ provider, providerLoading }) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const errors = Object.values(
|
||||||
|
error.response.data.errors || [['Failed while saving!']],
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const [error] of errors) {
|
||||||
|
enqueueSnackbar(error, {
|
||||||
|
variant: 'error',
|
||||||
|
SnackbarProps: {
|
||||||
|
'data-test': 'snackbar-update-role-mappings-error',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
throw new Error('Failed while saving!');
|
throw new Error('Failed while saving!');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -66,10 +66,10 @@ function RoleMappingsFieldArray() {
|
|||||||
<MuiTextField
|
<MuiTextField
|
||||||
{...params}
|
{...params}
|
||||||
label={formatMessage('roleMappingsForm.role')}
|
label={formatMessage('roleMappingsForm.role')}
|
||||||
|
required
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
loading={isRolesLoading}
|
loading={isRolesLoading}
|
||||||
required
|
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<IconButton
|
<IconButton
|
||||||
|
Reference in New Issue
Block a user