change(ui) - role modify/create fetch list and show feedback msg
This commit is contained in:
parent
165281367b
commit
68ea046919
2 changed files with 7 additions and 3 deletions
|
|
@ -43,7 +43,11 @@ function Roles(props: Props) {
|
|||
}
|
||||
}, [removeErrors])
|
||||
|
||||
const closeModal = () => {
|
||||
const closeModal = (showToastMessage) => {
|
||||
if (showToastMessage) {
|
||||
toast.success(showToastMessage)
|
||||
props.fetchList()
|
||||
}
|
||||
setShowmModal(false)
|
||||
setTimeout(() => {
|
||||
init()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ interface Props {
|
|||
role: any,
|
||||
edit: (role: any) => void,
|
||||
save: (role: any) => Promise<void>,
|
||||
closeModal: () => void,
|
||||
closeModal: (toastMessage?: string) => void,
|
||||
saving: boolean,
|
||||
permissions: Array<Permission>[]
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ const RoleForm = ({ role, closeModal, edit, save, saving, permissions }: Props)
|
|||
let focusElement = useRef<any>(null)
|
||||
const _save = () => {
|
||||
save(role).then(() => {
|
||||
closeModal()
|
||||
closeModal(role.exists() ? "Role updated" : "Role created");
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue