feat: add error snackbar for updating role mappings
This commit is contained in:
@@ -56,6 +56,19 @@ function RoleMappings({ provider, providerLoading }) {
|
||||
});
|
||||
}
|
||||
} 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!');
|
||||
}
|
||||
};
|
||||
|
@@ -66,10 +66,10 @@ function RoleMappingsFieldArray() {
|
||||
<MuiTextField
|
||||
{...params}
|
||||
label={formatMessage('roleMappingsForm.role')}
|
||||
required
|
||||
/>
|
||||
)}
|
||||
loading={isRolesLoading}
|
||||
required
|
||||
/>
|
||||
</Stack>
|
||||
<IconButton
|
||||
|
Reference in New Issue
Block a user