Merge pull request #2122 from automatisch/AUT-1239

feat: add error snackbar for updating role mappings
This commit is contained in:
Ali BARIN
2024-10-21 16:44:24 +02:00
committed by GitHub
2 changed files with 14 additions and 1 deletions

View File

@@ -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!');
}
};

View File

@@ -66,10 +66,10 @@ function RoleMappingsFieldArray() {
<MuiTextField
{...params}
label={formatMessage('roleMappingsForm.role')}
required
/>
)}
loading={isRolesLoading}
required
/>
</Stack>
<IconButton