fix(ui) - remove role errors
This commit is contained in:
parent
5f3f46d58c
commit
762b681f90
1 changed files with 9 additions and 7 deletions
|
|
@ -31,6 +31,14 @@ function Roles(props: Props) {
|
|||
props.fetchList()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (removeErrors && removeErrors.size > 0) {
|
||||
removeErrors.forEach(e => {
|
||||
toast.error(e)
|
||||
})
|
||||
}
|
||||
}, [removeErrors])
|
||||
|
||||
const closeModal = () => {
|
||||
setShowmModal(false)
|
||||
setTimeout(() => {
|
||||
|
|
@ -48,13 +56,7 @@ function Roles(props: Props) {
|
|||
header: 'Roles',
|
||||
confirmation: `Are you sure you want to remove this role?`
|
||||
})) {
|
||||
deleteRole(role.roleId).then(() => {
|
||||
if (removeErrors && removeErrors.size > 0) {
|
||||
removeErrors.forEach(e => {
|
||||
toast.error(e)
|
||||
})
|
||||
}
|
||||
})
|
||||
deleteRole(role.roleId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue