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')
|
else if (action === 'delete')
|
||||||
await service.delete(record.id)
|
await service.delete(record.id)
|
||||||
}
|
}
|
||||||
onComplete?.()
|
if (onComplete)
|
||||||
|
await onComplete()
|
||||||
},
|
},
|
||||||
setLoader,
|
setLoader,
|
||||||
errorMsg
|
errorMsg
|
||||||
|
@ -24,7 +24,7 @@ export const PermissionController = () => {
|
|||||||
const [showLoader, setShowLoader] = useState(false)
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
const [permissions, setPermissions] = useState([])
|
const [permissions, setPermissions] = useState([])
|
||||||
|
|
||||||
const updateTable = () => invokeWebApiWrapperAsync(
|
const updateTable = async () => invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
const permission = await AdminPermissionService.getAll()
|
const permission = await AdminPermissionService.getAll()
|
||||||
setPermissions(permission ?? [])
|
setPermissions(permission ?? [])
|
||||||
@ -33,7 +33,7 @@ export const PermissionController = () => {
|
|||||||
`Не удалось загрузить список прав`
|
`Не удалось загрузить список прав`
|
||||||
)
|
)
|
||||||
|
|
||||||
useEffect(updateTable, [])
|
useEffect(() => updateTable(), [])
|
||||||
|
|
||||||
const handlerProps = {
|
const handlerProps = {
|
||||||
service: AdminPermissionService,
|
service: AdminPermissionService,
|
||||||
|
Loading…
Reference in New Issue
Block a user