forked from ddrilling/asb_cloud_front
makeActionHandler теперь ожидает onComplete
This commit is contained in:
parent
c12ce68a96
commit
d3412492ff
@ -18,7 +18,8 @@ export const makeActionHandler = (action, { service, setLoader, errorMsg, onComp
|
||||
else if (action === 'delete')
|
||||
await service.delete(record.id)
|
||||
}
|
||||
onComplete?.()
|
||||
if (onComplete)
|
||||
await onComplete()
|
||||
},
|
||||
setLoader,
|
||||
errorMsg
|
||||
|
@ -24,7 +24,7 @@ export const PermissionController = () => {
|
||||
const [showLoader, setShowLoader] = useState(false)
|
||||
const [permissions, setPermissions] = useState([])
|
||||
|
||||
const updateTable = () => invokeWebApiWrapperAsync(
|
||||
const updateTable = async () => invokeWebApiWrapperAsync(
|
||||
async () => {
|
||||
const permission = await AdminPermissionService.getAll()
|
||||
setPermissions(permission ?? [])
|
||||
@ -33,7 +33,7 @@ export const PermissionController = () => {
|
||||
`Не удалось загрузить список прав`
|
||||
)
|
||||
|
||||
useEffect(updateTable, [])
|
||||
useEffect(() => updateTable(), [])
|
||||
|
||||
const handlerProps = {
|
||||
service: AdminPermissionService,
|
||||
|
Loading…
Reference in New Issue
Block a user